X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 040F59DCC40 for ; Mon, 5 Dec 2005 23:07:43 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20921-10 for ; Mon, 5 Dec 2005 23:07:46 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp104.mail.sc5.yahoo.com (smtp104.mail.sc5.yahoo.com [66.163.169.223]) by postgresql.org (Postfix) with SMTP id CB8D09DCAF0 for ; Mon, 5 Dec 2005 23:07:39 -0400 (AST) Received: (qmail 90851 invoked from network); 6 Dec 2005 03:07:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=Yahoo.com; h=Received:Received:Message-ID:Date:From:User-Agent:X-Accept-Language:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=DmxEjc9XWdlSFHSy1ZtY10huMb3c6ymyvxKar9Ru25imkuN1Tt6MI3K8ht5LOsnWQuCPB2QSKflnlXk+seVtoonKshemky4sce1yqNKFqGMkgttWa64WTl2rLqGqxmZbdib2u2fvteh60nEWSPcX6Nj8yXkX6SERrC5avtuA/44= ; Received: from unknown (HELO jupiter.black-lion.info) (janwieck@68.80.245.191 with login) by smtp104.mail.sc5.yahoo.com with SMTP; 6 Dec 2005 03:07:43 -0000 Received: from [172.21.8.23] (mars.black-lion.info [192.168.192.101]) (authenticated bits=0) by jupiter.black-lion.info (8.12.10/8.12.9) with ESMTP id jB637f1o015958; Mon, 5 Dec 2005 22:07:41 -0500 (EST) (envelope-from JanWieck@Yahoo.com) Message-ID: <43950068.3040402@Yahoo.com> Date: Mon, 05 Dec 2005 22:07:20 -0500 From: Jan Wieck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Riess CC: pgsql-performance@postgresql.org Subject: Re: 15,000 tables - next step References: <4391BF0F.9000208@Yahoo.com> <20051203162642.GA29022@surnet.cl> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.359 required=5 tests=[AWL=-0.120, DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.359 X-Spam-Level: X-Archive-Number: 200512/140 X-Sequence-Number: 15961 On 12/4/2005 4:33 AM, Michael Riess wrote: > I will do the following: > > - switch to 10k buffers on a 1GB machine, 20k buffers on a 2GB machine > - try to optimize my connection polls to remember which apps (groups of > 30 tables) were accessed, so that there is a better chance of using caches > - "swap out" tables which are rarely used: export the content, drop the > table, and re-create it on the fly upon access. I hacked pgbench a little and did some tests (finally had to figure out for myself if there is much of an impact with hundreds or thousands of tables). The changes done to pgbench: - Use the [-s n] value allways, instead of determining the scaling from the DB. - Lower the number of accounts per scaling factor to 10,000. - Add another scaling type. Option [-a n] splits up the test into n schemas, each containing [-s n] branches. The tests were performed on a 667 MHz P3, 640MB Ram with a single IDE disk. All tests were IO bound. In all tests the number of clients was 5 default transaction and 50 readonly (option -S). The FreeBSD kernel of the system is configured to handle up to 50,000 open files, fully cache directories in virtual memory and to lock all shared memory into physical ram. The different scalings used were init -a1 -s3000 run -a1 -s300 and init -a3000 -s1 run -a300 -s1 The latter creates a database of 12,000 tables with 1,200 of them actually in use during the test. Both databases are about 4 GB in size. The performance loss for going from -s3000 to -a3000 is about 10-15%. The performance gain for going from 1,000 shared_buffers to 48,000 is roughly 70% (-a3000 test case) and 100% (-s3000 test case). Conclusion: The right shared memory configuration easily outperforms the loss from increase in number of tables, given that the kernel is configured to be up to the task of dealing with thousands of files accessed by that number of backends too. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #