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.

Author bennoleslie
Recipients bennoleslie
Date 2013-01-01.09:36:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1357032962.36.0.684648136944.issue16833@psf.upfronthosting.co.za>
In-reply-to
Content
he http.client HTTPConnection._send_output method has an optimization for avoiding bad interactions between delayed-ack and the Nagle algorithm:

http://hg.python.org/cpython/file/f32f67d26035/Lib/http/client.py#l884

Unfortunately this interacts rather poorly if the case where the message_body is a bytes instance and is rather large.

If the message_body is bytes it is appended to the headers, which causes a copy of the data. When message_body is large this duplication of data can cause a significant spike in memory usage.

(In my particular case I was uploading a 200MB file to 30 hosts at the same leading to memory spikes over 6GB.

[There is a short thread discussing this issue on python-dev; Subject: "http.client Nagle/delayed-ack optimization"; Date: Dec 15, 2012]
History
Date User Action Args
2013-01-01 09:36:02bennolesliesetrecipients: + bennoleslie
2013-01-01 09:36:02bennolesliesetmessageid: <1357032962.36.0.684648136944.issue16833@psf.upfronthosting.co.za>
2013-01-01 09:36:01bennoleslielinkissue16833 messages
2013-01-01 09:36:01bennolesliecreate