[Nagios-devel] More Threads Please?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] More Threads Please?

Post by Guest »

Hello Everyone,

I've been profiling Nagios and found that at least on my installation with =
30,000+ checks that 60% of the time is spent in reaping events and 3% is s=
pent in saving status and another 1% is spent in writing out retention fil=
es.
This means that less than 30% is actually spent executing checks, to compou=
nd the problem the latency is really, really high and it looks like it's du=
e to high priority events blocking execution.
It seems to me that all of these "high priority" events are high priority b=
ecause they need to run right now, but I don't see why they need to block e=
xecution of everything else just to perform housekeeping tasks.

Assuming I were to put a mutex on the relevant objects, can anyone foresee =
a problem with running these high priority events in their own thread or ev=
en threads?

I have 2 designs in mind.
One would be a simple refactor that calls handle_timed_event with pthread c=
reate, on the high priority events.
This would create a new thread for each high priority event, but would be l=
iterally be a change to only a couple lines of code.

Another design would call for a breaking the main event loop into a high pr=
iority thread and a low priority thread.=20=20
In this case we would only have 2 threads, we loose a bit of the flexibilit=
y (and danger) and of having per event threads for high priority events, we=
also loose most of the overhead of thread creation.

I'm not sure high priority events are frequent enough that thread creation =
overhead is significant.

Anyways, as always your thoughts are very much appreciated.


NOTICE: This email message is for the sole use of the intended recipient(s=
) and may contain confidential and privileged information. Any unauthorized=
review, use, disclosure or distribution is prohibited. If you are not the =
intended recipient, please contact the sender by reply email and destroy al=
l copies of the original message.







This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked