	Sets a couple of options on the socket to the Monet DB server,
	increasing performance by a factor of 15.

	Adds a big long comment about the one socket option I didn't
	copy from MonetDB stream.c.

	To apply,

		$ cd /usr/local/lib/python2.5/site-packages/monetdb
		$ patch -p0 < mapi2.setsockopt.patch


--- /dev/null	2010-01-03 17:02:43.000000000 -0500
+++ ./mapi2.py	2010-01-04 00:30:41.000000000 -0500
@@ -66,6 +66,23 @@
         self.language = language
 
         self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+	s = self.socket
+
+        #
+        # For performance, mirror MonetDB/src/common/stream.c socket settings.
+        #
+
+        s.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 0)
+        s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
+
+        #
+        # Except for the IP packet type-of-service attribute.  Python
+        # didn't provide socket.IPTOS_THROUGHPUT, I didn't like the 
+        # look of picking throughput over reliability (see ip(7)), and 
+        # performance was much improved with the above two tweaks on their
+        # own.
+        #
+        #s.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, socket.IPTOS_THROUGHPUT)
 
         try:
             self.socket.connect((hostname, port))

Patch MonetDB's Python backend so it sets socket options. Makes things faster.
Patch MonetDB's Python backend so it sets socket options.
Makes things faster.
