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 |
<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">These two calls make our remote queries via libpq about twice as fast on average. It seems to me likeit might be a nice addition to the core product’s libpq (I poked it into the spot where the Nagle algorithm is turnedoff, but another place would be fine too). Can anyone give me a reason why it is a bad idea to add this in? If itwere made a parameter with a default of 64K, that would be even better. Then it could be tuned to particular systems formaximum throughput.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> on = 65535;</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> if (setsockopt(conn->sock, SOL_SOCKET, SO_RCVBUF,(char *) &on, sizeof(on)) < 0)</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> {</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> char sebuf[256];</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> printfPQExpBuffer(&conn->errorMessage,</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> libpq_gettext("could not set socket SO_RCVBUF window size: %s\n"),</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> SOCK_STRERROR(SOCK_ERRNO, sebuf,sizeof(sebuf)));</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> return 0;</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> }</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> on = 65535;</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> if (setsockopt(conn->sock, SOL_SOCKET, SO_SNDBUF,(char *) &on, sizeof(on)) < 0)</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> {</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> char sebuf[256];</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> printfPQExpBuffer(&conn->errorMessage,</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> libpq_gettext("could not set socket SO_SNDBUF window size: %s\n"),</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> SOCK_STRERROR(SOCK_ERRNO, sebuf,sizeof(sebuf)));</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> return 0;</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> }</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font></div>
pgsql-hackers by date: