A week ago, Adam Nelson (a Virginia-based Ruby developer) complained about Ruby’s “absolutely bullshit Ruby HTTP client situation.” He was running into a nasty situation where Ruby’s standard HTTP client library (net/http) was sending data in 1 kilobyte chunks, causing his CPU to redline. Due to net/http’s popularity (particularly with other libraries), Adam saw this as a big issue.
Today, Adam returns with a more scientific analysis of Ruby 1.8.x’s HTTP client performance. He discovers that while Ruby 1.8.6 and below have a hard-coded 1KB buffer size for HTTP reads, Ruby 1.8.7 extends the buffer to 16KB.
The results are very interesting and worth checking out, and while Adam’s his ultimate conclusion is that “Ruby’s Net::HTTP implementation blows,” he’s looking to work on the necessary changes to bring net/http up to speed. Read More