-
-
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
Support changes in the number of cpus given by cpu.Counts #640
Comments
As raised in #628 we should have OS-specific functions to gather the number of cores, |
@Lomanic Refer to the document about Update: I didn't consider that those two ways are only available on linux. I take it back. |
What do you think about just pulling up the implementations from Go without the caching? Every platform would of course need a different implementation. |
I think we shouldn't reuse Also almost all the platforms implement processor affinity (how many cores the process can run on) in |
Is your feature request related to a problem? Please describe.
In Telegraf, it has been suggested that we report changes to the number of cpus without restarting the process. In KVM, and many other hypervisors the number of cpus can be hotplugged on a running VM.
Currently we are calling
runtime.NumCPU()
in Telegraf directly, but I would like to move this to usecpu.Counts
. However, the implementation on Linux is the sameruntime.NumCPU()
call.Describe the solution you'd like
Instead of using the cached number of CPU from Go, each call to cpu.Counts() should attempt to discover the number of CPUs again.
Describe alternatives you've considered
None
Additional context
influxdata/telegraf#5451
The text was updated successfully, but these errors were encountered: