Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id BF70963275A for ; Tue, 17 Feb 2009 03:20:13 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 53686-08 for ; Tue, 17 Feb 2009 03:20:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.infogears.com (mail.infogears.com [69.51.90.143]) by mail.postgresql.org (Postfix) with ESMTP id A82B563267A for ; Tue, 17 Feb 2009 03:20:07 -0400 (AST) Received: from mail.infogears.com (localhost.localdomain [127.0.0.1]) by mail.infogears.com (Postfix) with ESMTP id A00C43098098; Tue, 17 Feb 2009 00:20:04 -0700 (MST) Received: from (HELO [69.51.88.19]) () (smtp-auth username rconover, mechanism plain) by mail.infogears.com (qpsmtpd/0.31-dev) with ESMTP; Tue, 17 Feb 2009 00:20:04 -0700 Cc: pgsql-performance Message-Id: <3FAF940B-9B0B-4DBA-8728-6096022129DF@infogears.com> From: Rusty Conover To: "Ross J. Reedstrom" In-Reply-To: <20090217070403.GB2486@cooker> Content-Type: multipart/alternative; boundary=Apple-Mail-10-997448448 Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: TCP network cost Date: Tue, 17 Feb 2009 00:20:02 -0700 References: <20090217070403.GB2486@cooker> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on mail.infogears.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200902/183 X-Sequence-Number: 32764 --Apple-Mail-10-997448448 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Feb 17, 2009, at 12:04 AM, Ross J. Reedstrom wrote: > Recently I've been working on improving the performance of a system > that > delivers files stored in postgresql as bytea data. I was surprised at > just how much a penalty I find moving from a domain socket > connection to > a TCP connection, even localhost. For one particular 40MB file > (nothing > outragous) I see ~ 2.5 sec. to download w/ the domain socket, but ~ > 45 sec > for a TCP connection (either localhost, name of localhost, or from > another machine 5 hops away (on campus - gigabit LAN) Similar numbers > for 8.2.3 or 8.3.6 (on Linux/Debian etch + backports) > > So, why the 20 fold penalty for using TCP? Any clues on how to trace > what's up in the network IO stack? Try running tests with ttcp to eliminate any PostgreSQL overhead and find out the real bandwidth between the two machines. If its results are also slow, you know the problem is TCP related and not PostgreSQL related. Cheers, Rusty -- Rusty Conover rconover@infogears.com InfoGears Inc / GearBuyer.com / FootwearBuyer.com http://www.infogears.com http://www.gearbuyer.com http://www.footwearbuyer.com --Apple-Mail-10-997448448 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable
On Feb 17, 2009, = at 12:04 AM, Ross J. Reedstrom wrote:

Recently I've been working on improving the = performance of a system that
delivers files stored in postgresql as = bytea data. I was surprised at
just how much a penalty I find moving = from a domain socket connection to
a TCP connection, even localhost. = For one particular 40MB file (nothing
outragous) I see ~ 2.5 sec. to = download w/ the domain socket, but ~ 45 sec
for a TCP connection = (either localhost, name of localhost, or from
another machine 5 hops = away (on campus - gigabit LAN) Similar numbers
for 8.2.3 or 8.3.6 (on = Linux/Debian etch + backports)

So, why the 20 fold penalty for = using TCP? Any clues on how to trace
what's up in the network IO = stack?

Try running tests with ttcp = to eliminate any PostgreSQL overhead and find out the real bandwidth = between the two machines.  If its results are also slow, you know = the problem is TCP related and not PostgreSQL = related.

Cheers,

Rusty
Rusty Conover
InfoGears Inc / GearBuyer.com / FootwearBuyer.com
<= a = href=3D"http://www.gearbuyer.com">http://www.gearbuyer.com
<= a = href=3D"http://www.footwearbuyer.com">http://www.footwearbuyer.com







= --Apple-Mail-10-997448448--