Nginx Logging to Zeromq Module - Sparkngin

W-Mark Kubacki wmark+nginx at
Tue Dec 10 15:00:08 UTC 2013

2013/12/10 MAGNIEN, Thierry <thierry.magnien at>:
> I don't know much about Zeromq performance, but we pushed redis to about 300k commands per second on our production servers (8 cores), and benchmarks on better hardware (24 cores) show it could handle close to 500k/s.

ØMQ should come pretty close or even exceed that. You will require a
free core for its process, though.
      Nevertheless implementing it looks rather straightforward (I've
done it in a different product) and with an event consumer (Nginx
being the producer) you will get one part of a fantastic local
analytics tool, similar to Piwik.

Here's an introduction to authentication and encryption:

Here's how you can prototype the plugin using Lua:

[7a] — initialize context
— the place for PUB sockets
— collect data for logging, and send a multipart message here…
— … that's how the call looks like

Everything else on the consumer will be counters of some sort. You
could still use Redis there for small sites, though.

Other noteworthy data structures for the consumer:

I've written this in the hope that other developers of Nginx modules
have an idea on where to start (their sockets, for example ;-) ). We
should move discussion of further details to a sparkngin group.


More information about the nginx-devel mailing list