Net::HTTP POST performance
Net::HTTP uses a fixed block size of 1024 bytes when streaming or chunking POST bodies, which leads to very poor performance for large file uploads.
Issue affects both trunk and branches/ruby_1_8
The attached tiny patch changes this to a tunable constant (BUFSIZE) with a default of 16K.
- A similar change has already been made to net/protocol.rb in r12092
- WEBrick httprequest and httpresponse already have a BUFSIZE constant
- WEBrick was made even more tunable in r10167 (trunk only) =end
Updated by shyouhei (Shyouhei Urabe) over 10 years ago
- Assignee changed from shyouhei (Shyouhei Urabe) to wyhaines (Kirk Haines)
Fixed in 1.8.7. 1.8.6 also uses 1K buffer, so I assign this to Kirk.
Note that typical Ethernet frame body is 1,500 octets length. Using 1K buffer leads at least 2 system calls per a packet on most situations.