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 262AFD82C0 for ; Fri, 18 Nov 2005 11:13:56 -0400 (AST) 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 30513-06 for ; Fri, 18 Nov 2005 15:13:59 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.Mi8.com (d01gw01.mi8.com [63.240.6.47]) by svr1.postgresql.org (Postfix) with ESMTP id 17DBAD6D50 for ; Fri, 18 Nov 2005 11:13:52 -0400 (AST) Received: from 172.16.1.110 by mail.Mi8.com with ESMTP (- Welcome to Mi8 Corporation www.Mi8.com (D1)); Fri, 18 Nov 2005 10:13:43 -0500 X-Server-Uuid: 241911D6-425B-44B9-A073-E3FE0F8FC774 Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.175]) by D01SMTP01.Mi8.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 18 Nov 2005 10:13:43 -0500 Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( [172.16.1.104]) with Microsoft Exchange Server HTTP-DAV ; Fri, 18 Nov 2005 10:13:42 -0500 User-Agent: Microsoft-Entourage/11.2.1.051004 Date: Fri, 18 Nov 2005 07:13:42 -0800 Subject: Re: Hardware/OS recommendations for large databases ( From: "Luke Lonergan" To: "Dave Cramer" cc: "Greg Stark" , "Joshua Marsh" , pgsql-performance@postgresql.org Message-ID: Thread-Topic: [PERFORM] Hardware/OS recommendations for large databases ( Thread-Index: AcXsQAi9HGMh4pFwSiam1ZsLnxnClAAEqB0s In-Reply-To: <0F3B99E2-4575-42B8-8AAC-3FE4B231348C@fastcrypt.com> MIME-Version: 1.0 X-OriginalArrivalTime: 18 Nov 2005 15:13:43.0481 (UTC) FILETIME=[AA139290:01C5EC52] X-WSS-ID: 6F63302D21G13482411-01-01 Content-Type: multipart/alternative; boundary=B_3215142822_2162763 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.254 required=5 tests=[AWL=-0.000, HTML_MESSAGE=0.001, RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 1.254 X-Spam-Level: * X-Archive-Number: 200511/351 X-Sequence-Number: 15608 > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3215142822_2162763 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Dave, On 11/18/05 5:00 AM, "Dave Cramer" wrote: >=20 > Now there's an interesting line drawn in the sand. I presume you have > numbers to back this up ? >=20 > This should draw some interesting posts. Part 2: The answer System A: > This system is running RedHat 3 Update 4, with a Fedora 2.6.10 Linux kern= el. >=20 > On a single table with 15 columns (the Bizgres IVP) at a size double memo= ry > (2.12GB), Postgres 8.0.3 with Bizgres enhancements takes 32 seconds to sc= an > the table: that=B9s 66 MB/s. Not the efficiency I=B9d hope from the onboard = SATA > controller that I=B9d like, I would have expected to get 85% of the 100MB/s= raw > read performance. >=20 > So that=B9s $1,200 / 66 MB/s (without adjusting for 2003 price versus now) = =3D > 18.2 $/MB/s >=20 > Raw data: > [llonergan@kite4 IVP]$ cat scan.sh > #!/bin/bash >=20 > time psql -c "select count(*) from ivp.bigtable1" dgtestdb > [llonergan@kite4 IVP]$ cat sysout1 > count =20 > ---------- > 10000000 > (1 row) >=20 >=20 > real 0m32.565s > user 0m0.002s > sys 0m0.003s >=20 > Size of the table data: > [llonergan@kite4 IVP]$ du -sk dgtestdb/base > 2121648 dgtestdb/base >=20 System B: > This system is running an XFS filesystem, and has been tuned to use very = large > (16MB) readahead. It=B9s running the Centos 4.1 distro, which uses a Linux > 2.6.9 kernel. >=20 > Same test as above, but with 17GB of data takes 69.7 seconds to scan (!) > That=B9s 244.2MB/s, which is obviously double my earlier point of 110-120MB= /s. > This system is running with a 16MB Linux readahead setting, let=B9s try it = with > the default (I think) setting of 256KB =AD AHA! Now we get 171.4 seconds or > 99.3MB/s. >=20 > So, using the tuned setting of =B3blockdev =8Bsetra 16384=B2 we get $6,000 / 24= 4MB/s > =3D 24.6 $/MB/s > If we use the default Linux setting it=B9s 2.5x worse. >=20 > Raw data: > [llonergan@modena2 IVP]$ cat scan.sh > #!/bin/bash >=20 > time psql -c "select count(*) from ivp.bigtable1" dgtestdb > [llonergan@modena2 IVP]$ cat sysout3 > count =20 > ---------- > 80000000 > (1 row) >=20 >=20 > real 1m9.875s > user 0m0.000s > sys 0m0.004s > [llonergan@modena2 IVP]$ !du > du -sk dgtestdb/base > 17021260 dgtestdb/base Summary: OK =AD you can get more I/O bandwidth out of the current I/O path for sequential scan if you tune the filesystem for large readahead. This is a cheap alternative to overhauling the executor to use asynch I/O. Still, there is a CPU limit here =AD this is not I/O bound, it is CPU limited as evidenced by the sensitivity to readahead settings. If the filesystem could do 1GB/s, you wouldn=B9t go any faster than 244MB/s. - Luke --B_3215142822_2162763 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Re: [PERFORM] Hardware/OS recommendations for large databases (</TIT= LE> </HEAD> <BODY> <FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN STYLE=3D'font-size:14.0px'>Dave,= <BR> <BR> On 11/18/05 5:00 AM, "Dave Cramer" <pg@fastcrypt.com> wrote= :<BR> <FONT COLOR=3D"#0000FF">> <BR> > Now there's an interesting line drawn in the sand. I presume you have = <BR> > numbers to back this up ?<BR> > <BR> > This should draw some interesting posts.<BR> </FONT><BR> Part 2: The answer<BR> <BR> System A:<BR> </SPAN></FONT><BLOCKQUOTE><FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN STYL= E=3D'font-size:14.0px'>This system is running RedHat 3 Update 4, with a Fedora= 2.6.10 Linux kernel.<BR> <BR> On a single table with 15 columns (the Bizgres IVP) at a size double memory= (2.12GB), Postgres 8.0.3 with Bizgres enhancements takes 32 seconds to scan= the table: that’s 66 MB/s.  Not the efficiency I’d hope fr= om the onboard SATA controller that I’d like, I would have expected to= get 85% of the 100MB/s raw read performance.<BR> <BR> So that’s $1,200 / 66 MB/s (without adjusting for 2003 price versus n= ow) =3D 18.2 $/MB/s<BR> <BR> Raw data:<BR> </SPAN></FONT><SPAN STYLE=3D'font-size:14.0px'><FONT FACE=3D"Courier New">[llon= ergan@kite4 IVP]$ cat scan.sh <BR> #!/bin/bash<BR> <BR> time psql -c "select count(*) from ivp.bigtable1" dgtestdb<BR> [llonergan@kite4 IVP]$ cat sysout1<BR>   count   <BR> ----------<BR>  10000000<BR> (1 row)<BR> <BR> <BR> real    0m32.565s<BR> user    0m0.002s<BR> sys     0m0.003s<BR> <BR> Size of the table data:<BR> [llonergan@kite4 IVP]$ du -sk dgtestdb/base<BR> 2121648 dgtestdb/base<BR> </FONT><FONT FACE=3D"Verdana, Helvetica, Arial"><BR> </FONT></SPAN></BLOCKQUOTE><SPAN STYLE=3D'font-size:14.0px'><FONT FACE=3D"Verda= na, Helvetica, Arial">System B:<BR> </FONT></SPAN><BLOCKQUOTE><SPAN STYLE=3D'font-size:14.0px'><FONT FACE=3D"Verdan= a, Helvetica, Arial">This system is running an XFS filesystem, and has been = tuned to use very large (16MB) readahead.  It’s running the Cento= s 4.1 distro, which uses a Linux 2.6.9 kernel.<BR> <BR> Same test as above, but with 17GB of data takes 69.7 seconds to scan (!) &n= bsp;That’s 244.2MB/s, which is obviously double my earlier point of 11= 0-120MB/s.  This system is running with a 16MB Linux readahead setting,= let’s try it with the default (I think) setting of 256KB – AHA!= Now we get 171.4 seconds or 99.3MB/s.<BR> <BR> So, using the tuned setting of “blockdev —setra 16384” we= get $6,000 / 244MB/s =3D 24.6 $/MB/s<BR> If we use the default Linux setting it’s 2.5x worse.<BR> <BR> Raw data:<BR> </FONT><FONT FACE=3D"Courier New">[llonergan@modena2 IVP]$ cat scan.sh <BR> #!/bin/bash<BR> <BR> time psql -c "select count(*) from ivp.bigtable1" dgtestdb<BR> [llonergan@modena2 IVP]$ cat sysout3<BR>   count   <BR> ----------<BR>  80000000<BR> (1 row)<BR> <BR> <BR> real    1m9.875s<BR> user    0m0.000s<BR> sys     0m0.004s<BR> [llonergan@modena2 IVP]$ !du<BR> du -sk dgtestdb/base<BR> 17021260        dgtestdb/base<BR> </FONT></SPAN></BLOCKQUOTE><SPAN STYLE=3D'font-size:14.0px'><FONT FACE=3D"Couri= er New"><BR> </FONT><FONT FACE=3D"Verdana, Helvetica, Arial">Summary:<BR> <BR> <cough, cough> OK – you can get more I/O bandwidth out of the c= urrent I/O path for sequential scan if you tune the filesystem for large rea= dahead.  This is a cheap alternative to overhauling the executor to use= asynch I/O.<BR> <BR> Still, there is a CPU limit here – this is not I/O bound, it is CPU l= imited as evidenced by the sensitivity to readahead settings.   If= the filesystem could do 1GB/s, you wouldn’t go any faster than 244MB/= s.<BR> <BR> - Luke</FONT></SPAN> </BODY> </HTML> --B_3215142822_2162763--