On Tue, Aug 17, 2010 at 1:27 PM, Willy Tarreau <[email protected]> wrote:
> On Tue, Aug 17, 2010 at 12:00:01PM +0200, Alexander Staubo wrote:
>> Varnish logs binary entries to a circular buffer held in shared
>> memory. Each individual session event -- client connect, new header
>> line, backend connect, backend response, and so on -- is logged as a
>> separate log entry. Since it's just a memory write, it's incredibly
>> fast.
[snip]
> Inter-process synchronisation is not necessarily easy (polling...) but
> having an side-band inter-process unix-stream socket to transport message
> pointers depending on the filters the consumer would have subscribed to
> could result in a highly efficient process. This could also save complex
> sprintf() calls from the log producers.

You may be prematurely optimizing this idea. After all, HAProxy logs
continuously and indiscriminately to syslog, and that performs well.
Varnish streams data continuously to its shared memory buffer even
when there are no readers, in fact. The clients, when reading entries,
simply sleep 50ms every time they run out of log records to read.
Polling and subscription logic might make sense, but I would recommend
implementing a simplest possible version first.

Reply via email to