Increase the efficiency of passive checks

Andreas Ericsson ae at op5.se
Sat Apr 10 14:04:15 CEST 2004


Andrew_Hoying at blm.gov wrote:
> 
> Hello,
> 
> I'm currently running a Nagios server which is processing a little over
> 2000 passive checks every 10 minutes. I know the server has the memory and
> processing power to handle that many checks in half that time, however the
> bottle neck seems to be the size of the named pipe file and the speed at
> which it is read. I have Nagios set to check the file every second, which
> works fine, and it processes around 5 passive checks a second, however the
> server Nagios is running on is still only using around 4% of it's
> processing power and it's disk access is nominal. What can I do to increase
> the size of the named pipe, or move to shared memory, a Unix socket, or
> some other method of accepting passive checks that would speed it up
> without significantly rewriting Nagios? 

To alter the size of the named pipe, you need to hack the kernel 
sources. This is NOT recommended, since some programs expect a pipe to 
be of a certain size.

The easiest way would probably be to let nagios use a socket in 
non-blocking mode instead. The problem with that is that only one 
process at the time can access it, so you'll have to rewrite the passive 
check submitter to work in spinlock mode (a connect() retry every 10 ms 
should work ok). This will most likely produce a rather significant 
increase in system load, however, but by what you've told me so far that 
won't be a problem.

Another way to go would be to have an intermittent caching daemon which 
empties the pipe far more often than it would be feasible to expect 
nagios to be able to, and schedules write so that there's never more 
than 4096 bytes of data in the nagios cmd-pipe. This solution would 
scale much better, but would result in a system wide DOS if it ever runs 
out of memory, so you'll need to take that into account and code your 
way around it.

> Does anyone have a patch for 1.2
> that would solve this problem? Is 2.0 significantly better in this regard?
> 
The version of Nagios doesn't matter at all, since the size of the pipe 
is defined by the kernel.

> Thank you,
> Andrew
> 

-- 
Mvh
Andreas Ericsson
OP5 AB
+46 (0)733 709032
andreas.ericsson at op5.se


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list