From: Mathijs <bluescreen303@gmail.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Re: multithreading not working for requests to the same url
Date: Fri, 21 Jan 2011 05:05:45 -0800 (PST) [thread overview]
Message-ID: <a9d41870-1924-4e44-a9fc-4a3f6cee8809@30g2000yql.googlegroups.com> (raw)
In-Reply-To: <C21A51DE-4176-49C5-B988-91145A821A48@finn.de>
Thanks for the speedy reply.
I found my problem.
It turns out that it was my webbrowser queueing the requests.
Both firefox and chrome do this, but when hitting the same url from 2
different browsers, everything works fine.
On Jan 21, 1:59 pm, Konstantin Haase <k.ha...@finn.de> wrote:
> Concurrency is up to the concrete Rack handler (webserver), not rack.
>
> Konstantin
>
> On Jan 21, 2011, at 13:47 , Mathijs wrote:
>
> 144145
>
> 146
>
>
>
> > Hi all,
>
> > In my application, a lot of time is spent on /inbox.
> > However, it looks as if rack does not support handling multiple
> > requests to the same url simultaneously.
>
> > I used this 'demo' app:
> > class HelloWorld
> > def call(env)
> > sleep 15
> > [200, {'Content-Type' => 'text/plain'}, ["Hello world!"]]
> > end
> > end
> > run Helloworld.new
>
> > run with rackup demo.ru
> > open 3 browser tabs, enter these urls:
> > -147http://localhost:9292/path1
> > -148http://localhost:9292/path1
> > -149http://localhost:9292/path2
>
> > You'll see that if you start the requests roughly at the same time,
> > the first path1 and path2 will complete at the same time.
> > The second path1 comes 15sec behind.
>
> > Passing params (localhost:9292/path1?blah=3) will
> > trick the app to handle the request in parallel. Also, aliasing
> > localhost does the trick.
> > So it looks as if rack does some locking per url.
> > I couldn't find anything though.
>
> > I tried this under REE with mongrel and webrick and under jruby with
> > trinidad and webrick.
> > They all behave the same.
>
> > Is anyone aware of this behavior? What is the cause?
> > Thanks,
> > Mathijs
prev parent reply other threads:[~2011-01-21 13:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-21 12:47 multithreading not working for requests to the same url Mathijs
2011-01-21 12:59 ` Konstantin Haase
2011-01-21 13:05 ` Mathijs [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://groups.google.com/group/rack-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a9d41870-1924-4e44-a9fc-4a3f6cee8809@30g2000yql.googlegroups.com \
--to=rack-devel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).