-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Linux, try to use /proc/loadavg to get instaneous load (#2218) #2268
base: master
Are you sure you want to change the base?
Conversation
This is draft because I am not sure whether having a |
…d#2218) The /proc/loadavg file includes the traditional 1-, 5- and 15-minute loads plus an instantaneous count of processes that are ready to run. This lets us respond faster to new processes being launched by other processes.
Is there any chance of this getting merged? |
This changes the API of ninja's Frankly, besides me being skeptical that this function should return a different value depending on the operating system, using the instantaneous value also has drawbacks. The major one is that it, essentially being the value returned by Linux's This poses the risk of overloading the system as those I/O-waiting tasks are likely to become runnable again. And yes, if they become not runnable again soon, then this would mean that no new ninja jobs are started, even though there are spare CPU resources. However, in this case, the system is likely already I/O-bound and starting to compilation jobs would be counterproductive anyways. In summary, I am not sure if this change is sensible. |
The underlying problem this was meant to address (#2218) is actually the opposite: The current approach takes too long to notice when lots of processes are creating, leading to CPU oversubscription and potentially VM (and thus swap -> IO) oversubscription. Do you propose a different way to solve the same problem? |
Yes, see #1949, which got recently merged. |
The /proc/loadavg file includes the traditional 1-, 5- and 15-minute loads plus an instantaneous count of processes that are ready to run. This lets us respond faster to new processes being launched by other processes.