Got no response last time on setsockopt post, so I thought I would reiterate. - Mailing list pgsql-hackers

From Dann Corbit
Subject Got no response last time on setsockopt post, so I thought I would reiterate.
Date
Msg-id D425483C2C5C9F49B5B7A41F8944154701000715@postal.corporate.connx.com
Whole thread Raw
Responses Re: Got no response last time on setsockopt post, so I thought I would reiterate.
Re: Got no response last time on setsockopt post, so I thought I would reiterate.
List 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;

            }

 

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Selecting a constant question
Next
From: "Dann Corbit"
Date:
Subject: Re: Selecting a constant question