Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 06C20633CBA for ; Fri, 6 Nov 2009 11:30:29 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 99483-02-8 for ; Fri, 6 Nov 2009 15:30:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mail.postgresql.org (Postfix) with ESMTP id 4F57F635580 for ; Fri, 6 Nov 2009 10:37:45 -0400 (AST) Received: by fxm27 with SMTP id 27so248202fxm.3 for ; Fri, 06 Nov 2009 06:37:42 -0800 (PST) Received: by 10.204.32.76 with SMTP id b12mr881364bkd.165.1257518262515; Fri, 06 Nov 2009 06:37:42 -0800 (PST) Received: from ?192.168.0.76? (rrcs-64-183-7-130.west.biz.rr.com [64.183.7.130]) by mx.google.com with ESMTPS id 13sm38023bwz.10.2009.11.06.06.37.40 (version=SSLv3 cipher=RC4-MD5); Fri, 06 Nov 2009 06:37:41 -0800 (PST) Message-ID: <4AF434B2.7040207@emolecules.com> Date: Fri, 06 Nov 2009 06:37:38 -0800 From: Craig James User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Massan CC: pgsql-performance@postgresql.org Subject: Re: Problem with database performance, Debian 4gb ram ? References: <26157096.post@talk.nabble.com> In-Reply-To: <26157096.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200911/76 X-Sequence-Number: 36244 Massan wrote: > Hi all, > > I have now readed many many forums and tried many different solutions and I > am not getting good performance to database. You don't give nearly enough information. To begin with, why do you think performance is poor? What exactly are you measuring? What does your application do, at least in broad terms? Have you identified any particular SQL queries that are slow, and if so, have you run EXPLAIN ANALYZE on them? What is the output of EXPlAIN ANALYZE? What about your hardware, do you have a single disk, a huge RAID10 array, or something in between? How much memory, how many processors? The more information you provide, the more likely you will get a good answer. Craig > My server is Debian linux, with > 4gb ram, there is also java application and I am giving to that 512mb > (JAVA_OPTS) memory. In database there is now like 4milj rows. What should I > do better. > Now .conf is: > > max_connections = 80 > shared_buffers = 512MB > temp_buffers = 8MB > work_mem = 20MB > maintenance_work_mem = 384MB > wal_buffers = 8MB > checkpoint_segments = 128MB > effective_cache_size = 2304MB > cpu_tuple_cost = 0.0030 > cpu_index_tuple_cost = 0.0010 > cpu_operator_cost = 0.0005 > fsync = off > checkpoint_timeout = 1h > > and I am giving kernels like: > > sysctl -w kernel.shmmax=1073741824 > sysctl -w kernel.shmall=2097152 > > btw, what file I should modify to give this kernels as defaults ? > > Thank you very much ! Hope you can clear my problem !