Comments (10)
It will work if you flush the socket to send each request in a separate packet: https://github.com/macournoyer/thin/blob/master/spec/server/pipelining_spec.rb, which according to my latest tests is what browsers do.
Let me know if you find a way to improve.
from thin.
I'm now trying exactly as it looks in the specs and still don't get it to work. Could you try this code, and check if it works for you? https://gist.github.com/878447
I'm running Ruby 1.8.7 and Thin 1.2.8.
When trying to run the pipelining spec i get these failures:
'Thin::Server HTTP pipelining should pipeline request on same socket' FAILED
expected "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nContent-Length: 8\r\nConnection: keep-alive\r\nServer: thin 1.2.8 codename Black Keys\r\n\r\n/first-1" to include "/first-1" and "/second-2"
./pipelining_spec.rb:25:
'Thin::Server HTTP pipelining should not allow more persistent connection then maximum' FAILED
expected: 2,
got: 1 (using ==)
./pipelining_spec.rb:81:
from thin.
Same here - specs don't pass
Thin - git head
Rack - 1.2.2
Eventmachine - 0.12.10
from thin.
Spec pass for me but not this: https://gist.github.com/878447. Investigating...
from thin.
Have you made any progress investigating this?
from thin.
Unfortunately specs don't pass: https://gist.github.com/1433183
I am running these tests on Fedora Rawhide. However the specs did not passed either on older Fedoras with older Thin.
from thin.
I'm also seeing these spec failures on Gentoo Linux.
from thin.
The specs also fail for me on Ubuntu.
I also observed that using em-http-request 0.3.0 (and eventmachine 0.12.10) pipelining works against thin, but if you upgrade to em-http-request 1.0.2 (and eventmachine 1.0.0.beta) pipelining stops working against thin (though it continues to work against lighttpd and nginx).
The test script I was using was:
require 'eventmachine'
require 'em-http-request'
EM::run do
x = EM::HttpRequest.new("http://localhost:9292/")
a = []
10.times{ |i|
EM::next_tick{ a << x.get(:path => "/", :keepalive => true).callback{ puts i } }
}
end
from thin.
I'm seeing the test pipeline failures with em-http-request 0.2.14 and eventmachine 0.12.10.
from thin.
I can reproduce the same problem with: thin (1.5.0) and eventmachine (1.0.3). Using the em-http-request example from @ConradIrwin. Making the query against google works with keepalive.
from thin.
Related Issues (20)
- Thin isssue HOT 1
- SERVER_PORT is incorrectly set to 80 when SSL is used on default port of 443 HOT 3
- No implicit conversion of nil into String <TypeError> HOT 4
- Cannot start as a service
- Can't start Thin Server using Ruby 2.6 HOT 1
- Unable to install thin gem on macOS 11.0 Big Sur beta HOT 12
- Flaky specs HOT 1
- Fix mac install errors or document in readme HOT 2
- Running thin behind a pipe doesn't show messages HOT 4
- Building native extensions fails HOT 4
- Homepage in gemspec is not accessible HOT 2
- Include rack handler test HOT 1
- When the version 1.8.0 or 2.0.0 is released? HOT 8
- rspec doesn't run after cloning the repository HOT 1
- Not working on Debian / Linux Mint - eventmachine error HOT 1
- Multiple SSL certificates HOT 3
- 0712d603a31d97b9fa8a0260da400da2e4217d60
- Issue
- Support rack 3.0.0 HOT 1
- Support Mac M1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thin.