Project

General

Profile

Backport #1284

Net::HTTP POST performance

Added by candlerb (Brian Candler) almost 11 years ago. Updated over 8 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

Associated revisions

Revision 70271340
Added by wyhaines (Kirk Haines) over 9 years ago

lib/net/http.rb: Backport #1284 [ruby-core:22874]; Change Net:HTTP to use a block size of 16k instead of 1k when streaming or chunking POST bodies.
test/net/http/test_post_io.rb: Backport #1284 [ruby-core:22874]; A test to go with the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@28198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

History

#1

Updated by shyouhei (Shyouhei Urabe) almost 10 years ago

  • Status changed from Open to Assigned
  • Assignee set to nahi (Hiroshi Nakamura)

=begin

=end

#2

Updated by nahi (Hiroshi Nakamura) almost 10 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r26131.
Brian, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

#3

Updated by shyouhei (Shyouhei Urabe) over 9 years ago

  • Status changed from Closed to Assigned
  • Assignee changed from nahi (Hiroshi Nakamura) to shyouhei (Shyouhei Urabe)

=begin

=end

#4

Updated by shyouhei (Shyouhei Urabe) over 9 years ago

  • Assignee changed from shyouhei (Shyouhei Urabe) to wyhaines (Kirk Haines)

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

#5

Updated by wyhaines (Kirk Haines) over 9 years ago

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r28198.
Brian, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF