Giter Site home page Giter Site logo

Comments (10)

macournoyer avatar macournoyer commented on May 21, 2024

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.

PatrickLef avatar PatrickLef commented on May 21, 2024

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.

imanel avatar imanel commented on May 21, 2024

Same here - specs don't pass
Thin - git head
Rack - 1.2.2
Eventmachine - 0.12.10

from thin.

macournoyer avatar macournoyer commented on May 21, 2024

Spec pass for me but not this: https://gist.github.com/878447. Investigating...

from thin.

PatrickLef avatar PatrickLef commented on May 21, 2024

Have you made any progress investigating this?

from thin.

voxik avatar voxik commented on May 21, 2024

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.

graaff avatar graaff commented on May 21, 2024

I'm also seeing these spec failures on Gentoo Linux.

from thin.

ConradIrwin avatar ConradIrwin commented on May 21, 2024

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.

graaff avatar graaff commented on May 21, 2024

I'm seeing the test pipeline failures with em-http-request 0.2.14 and eventmachine 0.12.10.

from thin.

threez avatar threez commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.