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; }