git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 99c2b8b)
Set Win32 server-size socket buffer to 32k, for performance reasons.
2006年8月11日 20:44:20 +0000 (20:44 +0000)
2006年8月11日 20:44:20 +0000 (20:44 +0000)
Yoshiyuki Asaba


diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
index de672cc868b4ae455f82d97c76e9610e2f6ec8cf..3a4c74b0a84efdcbadaff6fa1ad0ad38d4d56e56 100644 (file)
--- a/src/backend/libpq/pqcomm.c
+++ b/src/backend/libpq/pqcomm.c
@@ -30,7 +30,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* 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;
}
+#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
* parameter, don't error out, because these aren't universally
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /