Re: Low throughput of binary inserts from windows to linux - Mailing list pgsql-performance

From Tom Lane
Subject Re: Low throughput of binary inserts from windows to linux
Date
Msg-id 21549.1165886726@sss.pgh.pa.us
Whole thread Raw
In response to Re: Low throughput of binary inserts from windows to linux  ("Axel Waggershauser" <awagger@web.de>)
Responses Re: Low throughput of binary inserts from windows to linux  (Florian Weimer <fweimer@bfk.de>)
Re: Low throughput of binary inserts from windows to linux  ("Axel Waggershauser" <awagger@web.de>)
List pgsql-performance
"Axel Waggershauser" <awagger@web.de> writes:
> I tested different sizes on linux some time ago and found that 64KB
> was optimal. But playing with different sizes again revealed that my
> windows->linux problem seems to be solved if I use _any_ other
> (reasonable - meaning something between 4K and 512K) power of two ?!?

I think this almost certainly indicates a Nagle/delayed-ACK
interaction.  I googled and found a nice description of the issue:
http://www.stuartcheshire.org/papers/NagleDelayedAck/

Note that there are no TCP connections in which message payloads are
exact powers of two (and no, I don't know why they didn't try to make
it so).  You are probably looking at a situation where this particular
transfer size results in an odd number of messages where the other sizes
do not, with the different overheads between Windows and everybody else
accounting for the fact that it's only seen with a Windows sender.

If you don't like that theory, another line of reasoning has to do with
the fact that the maximum advertiseable window size in TCP is 65535 ---
there could be some edge-case behaviors in the Windows and Linux stacks
that don't play nicely together for 64K transfer sizes.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Axel Waggershauser"
Date:
Subject: Re: Low throughput of binary inserts from windows to linux
Next
From: Michael Stone
Date:
Subject: Re: New to PostgreSQL, performance considerations