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

Re: SO_SNDBUF size is small on win32?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: "Yoshiyuki Asaba" <y-asaba(at)sraoss(dot)co(dot)jp>, andrew(at)dunslane(dot)net, kleptog(at)svana(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: SO_SNDBUF size is small on win32?
Date: 2006-06-27 18:43:57
Message-ID: 26403.1151433837@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
"Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
> We use non-blocking sockets in backend/port/win32/socket.c so we are
> able to deliver our "faked signals" while waiting for I/O on the socket.
> We specifically set it in pgwin32_socket().

Hm, that seems a bit grotty, but anyway I stand corrected.

> Given that, it might be a good idea to actually put the code there
> instead, to localise it. With a comment and a reference to that Q
> article.

No, I think the patch has it in the right place, because pgwin32_socket
would have no defensible way of knowing what the max send size would be.
(Indeed, with a slightly different implementation in pqcomm.c, there
would not *be* any hard upper limit; the current code wastes cycles
copying data around, when with a large message it probably should just
send() directly from the message buffer...)

I agree it needs a comment though.

>> What I would think might help is a patch on the libpq side (because it
>> *does* use a nonblocking socket) to avoid sending more than 
>> 8K per WSASend call.

> It could definitly be a good idea to have a patch there *as well*, but I
> think they'd both be affected.

On the libpq side, sending large messages is probably rare except for
COPY IN mode.  Has anyone noticed performance issues specifically with
COPY IN?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Mark WoodwardDate: 2006-06-27 18:49:58
Subject: Re: SO_SNDBUF size is small on win32?
Previous:From: Bruce MomjianDate: 2006-06-27 18:41:56
Subject: Re: posix_fadvise versus old kernels

pgsql-patches by date

Next:From: Mark WoodwardDate: 2006-06-27 18:49:58
Subject: Re: SO_SNDBUF size is small on win32?
Previous:From: Magnus HaganderDate: 2006-06-27 17:49:46
Subject: Re: SO_SNDBUF size is small on win32?

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