Re: Packet sizes on transfers between client/server - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: Packet sizes on transfers between client/server
Date
Msg-id 20050826170942.GA17537@winnie.fuhr.org
Whole thread Raw
In response to Packet sizes on transfers between client/server  ("Walker, Jed S" <Jed_Walker@cable.comcast.com>)
Responses Re: Packet sizes on transfers between client/server  (Michael Fuhr <mike@fuhr.org>)
List pgsql-novice
On Fri, Aug 26, 2005 at 10:02:55AM -0600, Walker, Jed S wrote:
> We are needing to cut-down network traffic between our PostgreSQL client
> and server. The network team says that PostgreSQL is transferring data
> in 256k packets with acks of around half that size. Is there a parameter
> or a connection string setting that can be changed to force the system
> to use larger packet sizes?

Are you sure those packet size figures are correct?  What link layer
are you using that allows 256k packet sizes?  Might the size be 256
instead of 256k?  And what ACKs are they talking about?  In a TCP
connection, *all* segments except the first have the ACK flag set,
and many of those segments will be carrying data.  ACKs carrying
no data should be small -- just big enough for the IP and TCP headers
(20 bytes + 20 bytes + 0 or more bytes for IP and/or TCP options;
network engineers might also be adding link-layer framing) -- and
the operating system determines when to send those.

If I'm reading the source correctly, PostgreSQL sends data in
8192-byte chunks, but how those writes are broken up or aggregated
into link-layer packets is up to the operating system.  If you're
seeing a lot of packets smaller than the link layer's MTU then I'd
guess the application is doing a lot of small queries.  If that's
the case, then maybe some of that work could be moved into server-side
functions.

Have you run a sniffer (tcpdump, ethereal, etc.) to verify what the
network team is telling you?  If so then it might be useful to see
some of that data.

--
Michael Fuhr

pgsql-novice by date:

Previous
From:
Date:
Subject: Re: Copy Failure
Next
From:
Date:
Subject: Re: SQL problem?