Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E403A633EB5 for ; Mon, 2 Nov 2009 10:22:47 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 61896-03 for ; Mon, 2 Nov 2009 14:22:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 28E9F633918 for ; Mon, 2 Nov 2009 10:22:37 -0400 (AST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N4xnn-0003oU-40 for pgsql-performance@postgresql.org; Mon, 02 Nov 2009 15:22:35 +0100 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2009 15:22:35 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2009 15:22:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-performance@postgresql.org From: Ivan Voras Subject: Re: Problem with database performance, Debian 4gb ram ? Date: Mon, 02 Nov 2009 15:22:03 +0100 Lines: 46 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.23 (X11/20090928) In-Reply-To: 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/13 X-Sequence-Number: 36181 Grant Masan wrote: > Hi Hi all, > > I have now readed many many forums and tried many different solutions > and I am not getting good performance to database. 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 ! You have given almost no information that can be used to help you. In particular, you seem to be mixing up Java performance and database performance (JAVA_OPTS has nothing to do with pg performance). How do you know your performance is low? What is your hardware, what performance do you get and what do you expect? If after this you are still convinced the problem is database-related, you will probably need to run a tool like http://pqa.projects.postgresql.org/ to search which queries are slow and then start analyzing each particular query. In short, there is no magical answer to your question :)