Open dmk23 opened 9 years ago
Looking at the busyness code i think it does not take in account workers's async cores but a global value for each process. I am not even sure the plugin has been ever tested in non-process modes.
Are you sure simpler cheaper algos are not enough ?
We picked busyness because it seemed to provide the most sensible and flexible controls for managing resources. Now that I had chance to observe its behavior in the async environment, I think it is worth pointing out several issues / open questions:
Any further thoughts appreciated...
cheaper_busyness configured with gevent, starting with 4 workers
a few request groups over a few hours (each "request group" hitting several web resources under uWSGI at a time) - about half of each spawning new workers:
Now, the disturbing thing is that despite hours of complete absence of requests the workers never get collected. I suspect busyness gets confused by async activity in Gevent, mistaking Gevent's work of managing greenlets for actual request activity. I should mention the total system's CPU meter shows near-idleness of uWSGI processes.
Here is my relevant config -
P.S. The issue might be related to requests that spawn extra threads/greenlets to complete their work. I noticed that if such requests are not involved busyness does not even try to spawn new workers. Perhaps it cannot properly account for user-spawned greenlets?
I should note that all our greenlets are expected to complete, though I am not sure of the right way way to validate this 100% in python runtime... Would tracebacker be suitable for that?
P.P.S. When new workers are spawned by busyness the clients waiting on them (via Apache mod_proxy) sometimes get their requests lost: