Re: [mongrel2] Using mongrel2 for 'event-notification'
- From:
- Loic d'Anterroches
- Date:
- 2010-12-22 @ 08:42
Hi,
> Mongrel2 uses zmq sockets to talk to backends, so I was wondering if
> anybody has experimented with writing a zmq 'server' that pumps out
> event notifications.
> Specifically, event-notifications in the form of HTTP POSTs.
>
> Sending out a large number of POSTs to listeners via curl may not
> scale well, so I was thinking of using zmq + mongrel2 to send out
> POSTs to listeners (i.e., I get HTTP processing for free?)
Quite a nice idea. The only thing is that your listeners must have
already open a connection with Mongrel2 for you to have their connection
ids. Once you have them, you can push as many as you want, you can even
push the same message to several listeners.
I have no idea about the number of messages you want to send, but in
this system you have:
zmq 'server' --> zmq --> Mongrel2 --> listeners
Your bottleneck can then be at several points. From the server to zmq,
it will be very fast and zmq will spool for you (yeah!). Then Mongrel2
will pick from the queue as fast as possible depending on the speed of
your listeners (network speed/latency). So if your listeners are super
fast, Mongrel2 may be the bottleneck, but I bet the limit factor will
nearly always be the listeners as you go WAN from Mongrel2 to the listeners.
Hope it helps,
loïc
--
Indefero - Project management and code hosting - http://www.indefero.net
Photon - Coming soon, PHP5 framework tuned for Mongrel2
Céondo Ltd - Web + Science = Fun - http://www.ceondo.com