Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 447A92E0031 for ; Fri, 16 May 2008 17:18:08 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 73186-02 for ; Fri, 16 May 2008 17:18:01 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.227]) by developer.postgresql.org (Postfix) with ESMTP id 6021D2E002C for ; Fri, 16 May 2008 17:18:04 -0300 (ADT) Received: by qb-out-0506.google.com with SMTP id a39so957425qbd.17 for ; Fri, 16 May 2008 13:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=TQmSmx4cIrvsthIJwL3yrnvqWSieVmyRE/JsnWhLByM=; b=uK9sWlS1JvSmErFgEfGz/cdRWsM9ShNZO6wqDCe7tDG5BOy4XSQQjAcewPxeXHywmYRGODUTvwYNglE6ri2YBsqH7qdBhEJJAMhLEVcOe+UjJYWSfU+RMsTEpKAS/8TmOx5ayn91vbNA5Vell0f3CowQLw43LD6+k5VGGC2xyCI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=w2R3DbUXRykN6tmyXLkNpHpSyQ4iQ95j0KCA3I0ZY7u/pWRmatu1KPRvB6af7O0A+2bg0fc18hiyOq9CiTkr24TZWnYEQe/viHehHJgiCGmSeh1t51WfNwlbFQJT7tG+W5+hs4FeqXbQ6Ai+tnvugeEOMPVyLy6qLrOHbY6GmDY= Received: by 10.114.75.1 with SMTP id x1mr4105527waa.150.1210969082204; Fri, 16 May 2008 13:18:02 -0700 (PDT) Received: by 10.114.137.7 with HTTP; Fri, 16 May 2008 13:18:02 -0700 (PDT) Message-ID: Date: Fri, 16 May 2008 14:18:02 -0600 From: "Scott Marlowe" To: "Roberto Edwins" Subject: Re: Setting up of a large database Cc: pgsql-admin@postgresql.org In-Reply-To: <97b70d40805161050w1c02e076o89253dc503d352ea@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <97b70d40805161050w1c02e076o89253dc503d352ea@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/156 X-Sequence-Number: 29240 On Fri, May 16, 2008 at 11:50 AM, Roberto Edwins wrote: > What are the values that should go in postgresql.conf for a larga > database, a couple of which tables shall contain over 100 million > records? Well, that really kind of depends. Is this a database to handle lots of users with small bank style transactions? Or is it designed to hold the text type content for millions of users but with only a handful accessing it at once? Or maybe it's a reporting database with lots of statistical data that will be accessed by one or two people at a time but do huge ugly queries. It really all kind of depends. A good idea is to keep from setting max clients any higher than you have to. Set shared_buffers around 25% of total memory to start, and set work_mem to about 8M or so. Note that it's easy to use up a lot of memory fast with higher work_mem settings because each sort / hash agg etc can use up work_mem worth of memory. 100 users times 2 sorts each would equal 8M*200 or 1600M with a setting of 8M work_mem. Most importantly, make small incremental changes and benchmark with a realistic load, it's the only way to be sure.