Logging API revamp

Ethan Galstad nagios at nagios.org
Mon Oct 15 01:24:50 CEST 2007


Andreas Ericsson wrote:
> So, I started looking into revamping the event queue logic, but ended up
> with a migraine from the cumbersome way logging is done, so I decided to
> try doing something about it, and the attached 3-patch series is the
> result from it.
> 
> It compiles alright, both for nagios and the cgi's. I haven't done much
> in the way of checking past that though, so testing would be welcome.
> 
> Given that the patches don't change much in the way of logic, they
> shouldn't really affect anything in significant way.
> 
[snip]

Thanks for the patches - they are excellent ideas.  I'll get them 
implemented when I get back to the US later this week.

For the event queue, I was thinking that a skip list structure might be 
best for efficiency (http://en.wikipedia.org/wiki/Skip_list).  The event 
queue is used in primarily two situations:

1. Popping events from the head of the list to be executed
2. Inserting events into the list (mid- or endpoint).

#1 is very efficient with a linked list, but performance with #2 can be 
quite bad in large lists.  Since a check event usually appears for each 
host/service that is defined, this can lead to bad performance - O(n^2) 
I believe - with large installations.  A skip list would bring the 
performance closer to O(log n).

Anyone have comments/experiences they care to share about the 
performance of skip lists and/or better alternatives?


Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/




More information about the Developers mailing list