This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: add disable_nagle_algorithm to SocketServer.TCPServer
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: kristjan.jonsson Nosy List: kristjan.jonsson, pitrou
Priority: normal Keywords: easy, patch

Created on 2009-06-04 10:32 by kristjan.jonsson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
disable_nagle.patch kristjan.jonsson, 2009-06-04 10:32
socketserver2.patch kristjan.jonsson, 2009-06-15 20:50
Messages (7)
msg88878 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-06-04 10:32
It is useful to be able to disable the Nagle algoritm on socket 
connections from the TCPServer.  These are typically used by HTTP servers.

If combined with write buffering (setting RequestHangler.wbufsize = -1) it  
can make sure that http responses are not subject to Nagle/Delayed-ack 
delays.  Disabling Nagle in addition to providing the buffering is 
necessary to make sure that the final wfile.flush() arrives promptly, in 
case a previous flush occurred and the final flush is small.

A patch is provided.
msg88886 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-06-04 15:46
Looks ok to me.
msg89046 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-06-07 16:44
Committed in revision 73272
msg89062 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-06-08 00:19
This patch should be committed to py3k after 3.1 is released.
msg89411 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-06-15 20:50
On consideration, it is more appropariate to have the 
disable_nagle_algorithm as part of StreamRequestHandler rather than in the 
TCPSockerServer.  It then sits right next to the rfile and wfile that 
affect it.
The RequestHandlers aren't documented as extensively as the socket 
servers, though, so the documentation will have to go.
Attached is a patch.
msg89657 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-06-24 09:17
Second patch applied in 73546
msg89795 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-06-28 21:35
Merged into py3k in revision 73648
History
Date User Action Args
2022-04-11 14:56:49adminsetgithub: 50442
2009-06-28 21:36:06kristjan.jonssonsetstatus: open -> closed
keywords: patch, patch, easy
2009-06-28 21:35:22kristjan.jonssonsetkeywords: patch, patch, easy

messages: + msg89795
2009-06-24 09:17:42kristjan.jonssonsetkeywords: patch, patch, easy

messages: + msg89657
2009-06-15 20:50:27kristjan.jonssonsetkeywords: patch, patch, easy
files: + socketserver2.patch
messages: + msg89411
2009-06-08 00:19:09pitrousetstatus: closed -> open
versions: + Python 3.2, - Python 2.7
messages: + msg89062

assignee: kristjan.jonsson
keywords: patch, patch, easy
2009-06-07 16:44:28kristjan.jonssonsetstatus: open -> closed
keywords: patch, patch, easy
resolution: accepted
messages: + msg89046
2009-06-04 15:46:02pitrousetkeywords: patch, patch, easy
nosy: + pitrou
messages: + msg88886

2009-06-04 10:32:55kristjan.jonssonsetkeywords: patch, patch, easy
components: + Library (Lib)
2009-06-04 10:32:40kristjan.jonssoncreate