mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Set Win32 server-size socket buffer to 32k, for performance reasons.
Yoshiyuki Asaba
This commit is contained in:
@ -30,7 +30,7 @@
|
|||||||
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.186 2006/07/14 05:28:27 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.187 2006/08/11 20:44:20 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -593,6 +593,20 @@ StreamConnection(int server_fd, Port *port)
|
|||||||
return STATUS_ERROR;
|
return STATUS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
/*
|
||||||
|
* This is a Win32 socket optimization. The ideal size is 32k.
|
||||||
|
* http://support.microsoft.com/kb/823764/EN-US/
|
||||||
|
*/
|
||||||
|
on = PQ_BUFFER_SIZE * 4;
|
||||||
|
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
|
* Also apply the current keepalive parameters. If we fail to set a
|
||||||
* parameter, don't error out, because these aren't universally
|
* parameter, don't error out, because these aren't universally
|
||||||
|
Reference in New Issue
Block a user