SO_SNDBUF size is small on win32?
От | Yoshiyuki Asaba |
---|---|
Тема | SO_SNDBUF size is small on win32? |
Дата | |
Msg-id | 20060628.002313.74731148.y-asaba@sraoss.co.jp обсуждение исходный текст |
Ответы |
Re: SO_SNDBUF size is small on win32?
Re: SO_SNDBUF size is small on win32? Re: SO_SNDBUF size is small on win32? |
Список | pgsql-hackers |
Hi, I see a performance issue on win32. This problem is causes by the following URL. http://support.microsoft.com/kb/823764/EN-US/ On win32, default SO_SNDBUF value is 8192 bytes. And libpq's buffer is 8192 too. pqcomm.c:117 #define PQ_BUFFER_SIZE 8192 send() may take as long as 200ms. So, I think we should increase SO_SNDBUF to more than 8192. I attache the patch. Regards, -- Yoshiyuki Asaba y-asaba@sraoss.co.jp Index: pqcomm.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/libpq/pqcomm.c,v retrieving revision 1.184 diff -c -r1.184 pqcomm.c *** pqcomm.c 5 Mar 2006 15:58:27 -0000 1.184 --- pqcomm.c 27 Jun 2006 15:17:18 -0000 *************** *** 593,598 **** --- 593,608 ---- return STATUS_ERROR; } + #ifdef WIN32 + on = PQ_BUFFER_SIZE * 2; + if (setsockopt(port->sock, SOL_SOCKET, SO_SNDBUF, + (char *) &on, sizeof(on)) < 0) + { + elog(LOG, "setsockopt(SO_SNDBUF) failed: %m"); + return STATUS_ERROR; + } + #endif + /* * Also apply the current keepalive parameters. If we fail to set a * parameter, don't errorout, because these aren't universally
В списке pgsql-hackers по дате отправления: