http://bugs.python.org/issue6192
Mergin revisions 73272 and 73546 to py3k
diff --git a/Lib/socketserver.py b/Lib/socketserver.py
index 92adbcf..2ed50b9 100644
--- a/Lib/socketserver.py
+++ b/Lib/socketserver.py
@@ -646,8 +646,15 @@
     rbufsize = -1
     wbufsize = 0
 
+    # Disable nagle algoritm for this socket, if True.
+    # Use only when wbufsize != 0, to avoid small packets.
+    disable_nagle_algorithm = False
+
     def setup(self):
         self.connection = self.request
+        if self.disable_nagle_algorithm:
+            self.connection.setsockopt(socket.IPPROTO_TCP,
+                                       socket.TCP_NODELAY, True)
         self.rfile = self.connection.makefile('rb', self.rbufsize)
         self.wfile = self.connection.makefile('wb', self.wbufsize)