Got no response last time on setsockopt post, so I thought I would reiterate.

From: "Dann Corbit" <DCorbit(at)connx(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Cc: "Larry McGhaw" <lmcghaw(at)connx(dot)com>
Subject: Got no response last time on setsockopt post, so I thought I would reiterate.
Date: 2007-06-11 22:17:00
Message-ID: D425483C2C5C9F49B5B7A41F8944154701000715@postal.corporate.connx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

These two calls make our remote queries via libpq about twice as fast on
average. It seems to me like it might be a nice addition to the core
product's libpq (I poked it into the spot where the Nagle algorithm is
turned off, but another place would be fine too). Can anyone give me a
reason why it is a bad idea to add this in? If it were made a parameter
with a default of 64K, that would be even better. Then it could be
tuned to particular systems for maximum throughput.

on = 65535;

if (setsockopt(conn->sock, SOL_SOCKET, SO_RCVBUF,(char *) &on,
sizeof(on)) < 0)

{

char sebuf[256];

printfPQExpBuffer(&conn->errorMessage,

libpq_gettext("could not set socket
SO_RCVBUF window size: %s\n"),


SOCK_STRERROR(SOCK_ERRNO, sebuf, sizeof(sebuf)));

return 0;

}

on = 65535;

if (setsockopt(conn->sock, SOL_SOCKET, SO_SNDBUF,(char *) &on,
sizeof(on)) < 0)

{

char sebuf[256];

printfPQExpBuffer(&conn->errorMessage,

libpq_gettext("could not set socket
SO_SNDBUF window size: %s\n"),


SOCK_STRERROR(SOCK_ERRNO, sebuf, sizeof(sebuf)));

return 0;

}

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dann Corbit 2007-06-11 22:18:33 Re: Selecting a constant question
Previous Message Alvaro Herrera 2007-06-11 22:16:04 Re: Selecting a constant question