Skip site navigation (1) Skip section navigation (2)

Re: TCP network cost

From: Rusty Conover <rconover(at)infogears(dot)com>
To: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
Cc: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: TCP network cost
Date: 2009-02-17 07:20:02
Message-ID: 3FAF940B-9B0B-4DBA-8728-6096022129DF@infogears.com (view raw or flat)
Thread:
Lists: pgsql-performance
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(at)infogears(dot)com
InfoGears Inc / GearBuyer.com / FootwearBuyer.com
http://www.infogears.com
http://www.gearbuyer.com
http://www.footwearbuyer.com







In response to

Responses

pgsql-performance by date

Next:From: davidDate: 2009-02-17 08:34:15
Subject: Re: TCP network cost
Previous:From: Ross J. ReedstromDate: 2009-02-17 07:04:03
Subject: TCP network cost

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group