librelist archives

« back to archive

"@*" as route path instead of "/brubeck"

"@*" as route path instead of "/brubeck"

From:
James Dennis
Date:
2011-03-24 @ 02:11
So I'm testing Brubeck vs Tornado on ec2 micro instances and noticed that
under heavy load Brubeck would have trouble routing some messages.

On closer inspection it appears Brubeck is recieving "@*" as the request
path at the times where Brubeck would get lost.

I can reliably reproduce by using siege to slam it with 500 conncurrent
connections.

Re: [mongrel2] "@*" as route path instead of "/brubeck"

From:
Loic d'Anterroches
Date:
2011-03-24 @ 07:46
Hello,

On 2011-03-24 03:11, James Dennis wrote:
> So I'm testing Brubeck vs Tornado on ec2 micro instances and noticed
> that under heavy load Brubeck would have trouble routing some messages.
> 
> On closer inspection it appears Brubeck is recieving "@*" as the request
> path at the times where Brubeck would get lost.
> 
> I can reliably reproduce by using siege to slam it with 500 conncurrent
> connections.

This is normal, I had this problem too. This is Mongrel2 informing your
handler that you tried to send an answer to a client which has already
closed the connection. Even if you have no route like that, this is a
"system" message. Take a look in the archive of the list, I was able to
get 8000 req/s like that on my handlers. You must ignore these services
messages (do not send anything back) or use them to update your internal
state if you have keep track of who is connected (long polling,
streaming, etc.).

So, PATH == @*, METHOD == JSON and type == disconnect => service message.

If you answer back something like a 404 error, Mongrel will snow ball
you the same message again and you will saturate both Mongrel2 and your
handlers.

loïc

--
Indefero - Project management and code hosting - http://www.indefero.net
Photon - High Performance PHP Framework - http://photon-project.com
Céondo Ltd - Web + Science = Fun - http://www.ceondo.com

Re: [mongrel2] "@*" as route path instead of "/brubeck"

From:
Jason Miller
Date:
2011-03-25 @ 04:17
Actually METHOD == JSON type == disconnect *always* means the connection
has closed, regardless of the path.  At least that's what Zed's sample
code uses to check that.
On 08:46 Thu 24 Mar     , Loic d'Anterroches wrote:
> Hello,
> 
> On 2011-03-24 03:11, James Dennis wrote:
> > So I'm testing Brubeck vs Tornado on ec2 micro instances and noticed
> > that under heavy load Brubeck would have trouble routing some messages.
> > 
> > On closer inspection it appears Brubeck is recieving "@*" as the request
> > path at the times where Brubeck would get lost.
> > 
> > I can reliably reproduce by using siege to slam it with 500 conncurrent
> > connections.
> 
> This is normal, I had this problem too. This is Mongrel2 informing your
> handler that you tried to send an answer to a client which has already
> closed the connection. Even if you have no route like that, this is a
> "system" message. Take a look in the archive of the list, I was able to
> get 8000 req/s like that on my handlers. You must ignore these services
> messages (do not send anything back) or use them to update your internal
> state if you have keep track of who is connected (long polling,
> streaming, etc.).
> 
> So, PATH == @*, METHOD == JSON and type == disconnect => service message.
> 
> If you answer back something like a 404 error, Mongrel will snow ball
> you the same message again and you will saturate both Mongrel2 and your
> handlers.
> 
> loïc
> 
> --
> Indefero - Project management and code hosting - http://www.indefero.net
> Photon - High Performance PHP Framework - http://photon-project.com
> Céondo Ltd - Web + Science = Fun - http://www.ceondo.com