Michael Engelhart
2008-Feb-14 15:46 UTC
[Mongrel] one mongrel request seems to block cluster
Hello - I''m new to setting up a mongrel cluster and ran into a question while doing some simple performance testing. I''m using Apache 2.2 as a proxy/load balancer to multiple mongrel instances (for this test on the same box - a small EC2 compute unit). I setup the cluster with 5 mongrel instances. Last night I ran "siege" against the server and the performance seemed to be fine while hitting a single rails action. But the app I''m working on does a web service request that can take up to 20 seconds to get a response. So to test concurrent performance for this long process while siege was running against a simple Rails action I used my browser to hit the page that called out to the long running web service. What happened next was that siege stopped outputting any response information until my browser returned with the response from the web service request. As I said I''m new to this and maybe I''m misinterpreting they way siege works but it "appeared" to me that ALL the mongrel instances were blocked while one handled this long running request. I can''t imagine that this is how it is supposed to work in a properly configured environment but I can''t find any other information from googling as to why this might be happening. It could very well just be a configuration problem on my end. I''m hoping that this is just siege blocking on it''s output :-) Thanks for any advice. Best Regards Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20080214/ffdf017f/attachment.html
At Thu, 14 Feb 2008 09:46:12 -0600, "Michael Engelhart" <mike.engelhart at gmail.com> wrote:> > Hello - > > I''m new to setting up a mongrel cluster and ran into a question while doing > some simple performance testing. > > I''m using Apache 2.2 as a proxy/load balancer to multiple mongrel instances > (for this test on the same box - a small EC2 compute unit). I setup the > cluster with 5 mongrel instances. > > [?]In your apache.conf, add the max & (maybe) acquire settings to each balancer member. <Proxy balancer://mongrel_cluster> BalancerMember http://127.0.0.1:12345 max=1 acquire=1 [?] </Proxy> See: <http://rubyforge.org/pipermail/mongrel-users/2007-October/004145.html> best, Erik Hetzner -------------- next part -------------- ;; Erik Hetzner, California Digital Library ;; gnupg key id: 1024D/01DB07E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20080214/5117547d/attachment.bin
Mike, That sounds similar to a problem I experienced last week. I''m running apache with mongrel on a windows machine. It''s not a definitive solution, and I am new to apache/mongrel, but with that important caveat out of the way I can say that I found playing with the TTL and timeout parameters in apache.conf had a positive effect. The downside is that some long-running queries may get a proxy timeout message from Apache. Since I''m using caching, this is not a serious problem - the next request for the same data usually succeeds. <Proxy balancer://mongrel_cluster> BalancerMember http://someip max=5 timeout=55 ttl=90 acquire=60 </Proxy> I also assigned a value to ProxyTimeout in the Virtualhost section of apache.conf. Comments are from the Apache documentation. <VirtualHost someip:port> #This is useful when you have a slow/buggy appserver which hangs, and you would rather just return a timeout and fail gracefully instead of waiting however long it takes the server to return. ProxyTimeout 90 </VirtualHost> Good luck, G u i W e i n m a n n A L P H A B E T W A R E On 2/14/08, Erik Hetzner <erik.hetzner at ucop.edu> wrote:> At Thu, 14 Feb 2008 09:46:12 -0600, > > "Michael Engelhart" <mike.engelhart at gmail.com> wrote: > > > > Hello - > > > > I''m new to setting up a mongrel cluster and ran into a question while doing > > some simple performance testing. > > > > I''m using Apache 2.2 as a proxy/load balancer to multiple mongrel instances > > (for this test on the same box - a small EC2 compute unit). I setup the > > cluster with 5 mongrel instances. > > > > > [?] > > In your apache.conf, add the max & (maybe) acquire settings to each > balancer member. > > <Proxy balancer://mongrel_cluster> > BalancerMember http://127.0.0.1:12345 max=1 acquire=1 > [?] > </Proxy> > > See: > > <http://rubyforge.org/pipermail/mongrel-users/2007-October/004145.html> > > best, > > Erik Hetzner > > ;; Erik Hetzner, California Digital Library > ;; gnupg key id: 1024D/01DB07E3 > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > >
Michael Engelhart
2008-Feb-14 19:22 UTC
[Mongrel] one mongrel request seems to block cluster
Hi Erik - Yes I meant to cc the list! :-) OK - that''s what I''m coming to the conclusion as well that this is the way siege behaves because I was able to get a request through just fine in a sub-second response while siege was hung. I''m glad you''re seeing this behavior as well so my load balancer is probably working. Thanks very much for looking into this. Mike On Thu, Feb 14, 2008 at 1:09 PM, Erik Hetzner <erik.hetzner at ucop.edu> wrote:> At Thu, 14 Feb 2008 12:33:44 -0600, > "Michael Engelhart" <mike.engelhart at gmail.com> wrote: > > > > Thanks Erik for the advice and link. > > > > After modifying the load balancer to use those parameters I''m still > > seeing the behavior though: > > > > Here are a few lines of output from siege before I hit the long > > running process with my browser. It generally just repeats at about > > this pace give or take a few milliseconds: > > HTTP/1.1 200 0.18 secs: 1998 bytes ==> /trips/1 > > HTTP/1.1 200 0.20 secs: 1998 bytes ==> /trips/1 > > > > But then when I hit my browser against the long running web service > > request, siege hangs for about 20 seconds > > > > Then siege dumps the following lines all at once which says to me > > that every request was blocked until the long running process ended: > > > [?] > > Hi Michael. > > (Did you mean to cc the list?) > > Anyhow, this looks like the same behavior. I think this is something > to do with the way that siege works, based on a simulation I just did > with siege on my own system. Can you get a response back from your > balancer (not from siege) when siege has hung? > > -Erik > > ;; Erik Hetzner, California Digital Library > ;; gnupg key id: 1024D/01DB07E3 > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20080214/aea82ff8/attachment.html