Re: Packet sizes on transfers between client/server

From: "Walker, Jed S" <Jed_Walker(at)cable(dot)comcast(dot)com>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Packet sizes on transfers between client/server
Date: 2005-08-26 17:41:51
Message-ID: F7638DABBEBB4A4CB70616DE2B19E6B825F589@COENGEXCMB01.cable.comcast.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thanks for the detailed response. I've forwarded this on to our network
and server teams. There is one process that could be sending small
queries/data back and forth that we are already working to move to the
server. Once that's done we'll see if the small packets go away (the
only other process pulling data regularly should be pulling schedules
which should be fairly large).

-----Original Message-----
From: Michael Fuhr [mailto:mike(at)fuhr(dot)org]
Sent: Friday, August 26, 2005 11:10 AM
To: Walker, Jed S
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] Packet sizes on transfers between client/server

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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message operationsengineer1 2005-08-26 17:51:18 Re: SQL problem?
Previous Message Michael Fuhr 2005-08-26 17:09:42 Re: Packet sizes on transfers between client/server