Project

General

Profile

Backport #1284

Net::HTTP POST performance

Added by candlerb (Brian Candler) about 11 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:22874]

Description

=begin
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.

Notes:

  • 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

Files

net-http-bufsize.patch (722 Bytes) net-http-bufsize.patch candlerb (Brian Candler), 03/13/2009 05:23 PM

Also available in: Atom PDF