Link to home
Start Free TrialLog in
Avatar of sriram
sriram

asked on

How to detect Unix server congestion in C++ program

Hello,
I am writing a C++ program on Solaris platform. The program continuously spawns worker threads for handling requests. Somehow the program has to detect OS congestion (high CPU, reached max usage limit or something like that) so that it could slow down handling requests and stop spawning new threads until congestion has gone. Please let me know whether it is possible.

I appreciate your help.

Thanks
Avatar of arnold
arnold
Flag of United States of America image

You should limit how many it can spawn/thread or make this a configuration option  This is presumably before your application reaches a point that it gets/traps an error  when malloc, or fork can not spawn, or a thread options have been exceeded.
ASKER CERTIFIED SOLUTION
Avatar of phoffric
phoffric

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sriram
sriram

ASKER

Thanks. Sorry for the late response.