X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 71784D70DC for ; Wed, 24 Aug 2005 01:22:33 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31461-10 for ; Wed, 24 Aug 2005 04:22:30 +0000 (GMT) Received: from unicorn.rentec.com (unicorn.rentec.com [216.223.240.9]) by svr1.postgresql.org (Postfix) with ESMTP id C598DD710D for ; Wed, 24 Aug 2005 01:22:28 -0300 (ADT) Received: from wren.rentec.com (wren.rentec.com [192.5.35.106]) by unicorn.rentec.com (8.13.1/8.12.1) with ESMTP id j7O4LLYC017574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Aug 2005 00:21:22 -0400 (EDT) X-Rentec: external Received: from [172.16.160.108] (stange-dhcp2.rentec.com [172.16.160.108]) by wren.rentec.com (8.13.1/8.12.1) with ESMTP id j7O4LIla011044; Wed, 24 Aug 2005 00:21:18 -0400 (EDT) Message-ID: <430BF0DA.5010002@rentec.com> Date: Wed, 24 Aug 2005 00:00:26 -0400 From: Alan Stange Organization: Renaissance Technologies Corp. User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Josh Berkus Cc: pgsql-performance@postgresql.org, Steve Poe , Chris Browne Subject: Re: Read/Write block sizes References: <60k6icpapm.fsf@dba2.int.libertyrms.com> <1124846743.12045.94.camel@amd64-laptop-spoe> <200508231931.29682.josh@agliodbs.com> In-Reply-To: <200508231931.29682.josh@agliodbs.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Logged: Logged by unicorn.rentec.com as j7O4LLYC017574 at Wed Aug 24 00:21:22 2005 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200508/369 X-Sequence-Number: 14116 Josh Berkus wrote: >Steve, > > > >>I would assume that dbt2 with STP helps minimize the amount of hours >>someone has to invest to determine performance gains with configurable >>options? >> >> > >Actually, these I/O operation issues show up mainly with DW workloads, so the >STP isn't much use there. If I can ever get some of these machines back >from the build people, I'd like to start testing some stuff. > >One issue with testing this is that currently PostgreSQL doesn't support block >sizes above 128K. We've already done testing on that (well, Mark has) and >the performance gains aren't even worth the hassle of remembering you're on a >different block size (like, +4%). > > What size database was this on? >What the Sun people have done with other DB systems is show that substantial >performance gains are possible on large databases (>100G) using block sizes >of 1MB. I believe that's possible (and that it probably makes more of a >difference on Solaris than on BSD) but we can't test it without some hackery >first. > We're running on a 100+GB database, with long streams of 8KB reads with the occasional _llseek(). I've been thinking about running with a larger blocksize with the expectation that we'd see fewer system calls and a bit more throughput. read() calls are a very expensive way to get 8KB of memory (that we know is already resident) during scans. One has to trap into the kernel, do the usual process state accounting, find the block, copy the memory to userspace, return back from the kernel to user space reversing all the process accounting, pick out the bytes one needs, and repeat all over again. That's quite a few sacrificial cache lines for 8KB. Yeah, sure, Linux syscalls are fast, but they aren't that fast, and other operating systems (windows and solaris) have a bit more overhead on syscalls. Regarding large blocks sizes on Solaris: the Solaris folks can also use large memory pages and avoid a lot of the TLB overhead from the VM system. The various trapstat and cpustat commands can be quite interesting to look at when running any large application on a Solaris system. It should be noted that having a large shared memory segment can be a performance looser just from the standpoint of TLB thrashing. O(GB) memory access patterns can take a huge performance hit in user space with 4K pages compared to the kernel which would be mapping the "segmap" (in Solaris parlance) with 4MB pages. Anyway, I guess my point is that the balance between kernel managed vs. postgresql managed buffer isn't obvious at all. -- Alan