Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5c9e9c0

Browse files
committed
Set Win32 server-size socket buffer to 32k, for performance reasons.
Yoshiyuki Asaba
1 parent99c2b8b commit5c9e9c0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

‎src/backend/libpq/pqcomm.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
3131
* Portions Copyright (c) 1994, Regents of the University of California
3232
*
33-
*$PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.186 2006/07/14 05:28:27 tgl Exp $
33+
*$PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.187 2006/08/11 20:44:20 momjian Exp $
3434
*
3535
*-------------------------------------------------------------------------
3636
*/
@@ -593,6 +593,20 @@ StreamConnection(int server_fd, Port *port)
593593
returnSTATUS_ERROR;
594594
}
595595

596+
#ifdefWIN32
597+
/*
598+
*This is a Win32 socket optimization. The ideal size is 32k.
599+
*http://support.microsoft.com/kb/823764/EN-US/
600+
*/
601+
on=PQ_BUFFER_SIZE*4;
602+
if (setsockopt(port->sock,SOL_SOCKET,SO_SNDBUF, (char*)&on,
603+
sizeof(on))<0)
604+
{
605+
elog(LOG,"setsockopt(SO_SNDBUF) failed: %m");
606+
returnSTATUS_ERROR;
607+
}
608+
#endif
609+
596610
/*
597611
* Also apply the current keepalive parameters. If we fail to set a
598612
* parameter, don't error out, because these aren't universally

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp