Problems with many hanging Nagios processes (Nagios spawning rogue nagios processes eventually crashing Nagios server)

Andreas Ericsson ae at op5.se
Wed Jan 3 11:04:05 CET 2007


Ethan Galstad wrote:
> Good work on nailing down the problem to the command buffer slots! 
> Sounds like this problem might affect a number of users, so I think we 
> need to patch Nagios. There are two possible solutions:
> 
> 1.  Bump up the default buffer slots to something larger.  Since Nagios 
> only immediately allocates memory for pointers, the additional memory 
> overhead is fairly small.  Allocated memory = (sizeof(char **)) * (# of 
> slots).
> 
> 2.  Moving the slots definitions out to command file variables.  This is 
> a better solution than having to edit the code and recompile.
> 
> Thoughts?
> 

3. Make the number of slots dynamic and allocate memory as needed. It 
should never release any allocated memory, but just increase the number 
of buffer slots as needed. One probably wants to allocate the buffer 
slots in chunks of sysconf(_SC_PAGESIZE) / (sizeof(char *)) to keep it 
to one page at a time, which will prevent expensive memory copying on 
realloc().

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV




More information about the Developers mailing list