Increase the efficiency of passive checks

Andreas Ericsson ae at op5.se
Tue Apr 13 10:23:10 CEST 2004


Mooney, Ryan wrote:
>  
> 
>>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.
> 
> 
> Hmm, that's a scary assumption for a program to make :> 

All shells have to make it, or |, > and < would fail miserably.
Also, some programs that accept input from stdin will have to be 
recompiled to make sure they don't suffer data-loss if the size of the 
unix pipe is altered.

> If you have
> a lot of passive checks some people have found it worth while to
> increase
> the size of the pipe since the kernel scheduler on some versions of the
> Linux kernel has poor behavior that causes the (forkedd) processes
> reading the
> pipe to hang for a really long time.  There was a thread on this a few
> months back, look for "[Nagios-users] Processes hung on pipe writes (and
> other fun)"
> for the thread.  
>  
> 
>>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.
> 
> 
> Not true, every process that connects to the socket will generate a
> separate
> fd, nagios could then use a select() to find out which were ready for 
> reading.  This would be a non trivial change requiring some coding
> skills
> though since the pipe thing is fairly entwined in how the whole process
> works 
> (not impossible just some time involved).
> 

Only if there is a process responding in the other end. For separate 
fd's to be generated, nagios has to fork() to accept() which breaks the 
way things are now and requires substantial rewriting (unless we specify 
a limited amount of sockets to use, which sort of defeats the purpose). 
Hacking the passive check result submitter to work with spinlocks seems 
a lot easier to me.


-- 
Mvh / Best Regards
Sourcerer / 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