sysinfo icon indicating copy to clipboard operation
sysinfo copied to clipboard

Support linux cgroup resource limit

Open tennix opened this issue 6 years ago • 7 comments

In Linux container environment, it should report the cpu and memory limit instead of the host machine's total cpu and memory. Golang has similar library handling this https://github.com/uber-go/automaxprocs.

tennix avatar Nov 11 '19 05:11 tennix

You mean if the linux is running in a container environment or if a specific program is running in a container environment? Because in the second case, I can add an option to switch from one state to another but it seems good as is for me.

GuillaumeGomez avatar Nov 11 '19 09:11 GuillaumeGomez

A program running in a container environment, users use this library may want to adjust the resources allocated according to the system info retrieved. For example, adjust the thread pool count and cache size, when in container environment, these needs to be the cgroup cpu/memory limit.

tennix avatar Nov 13 '19 02:11 tennix

Note we do not yet read CPU limits

jonashaag avatar Jul 25 '23 15:07 jonashaag

Best to keep this issue open then.

GuillaumeGomez avatar Jul 25 '23 15:07 GuillaumeGomez

I'm thinking about contributing cgroups CPU limits. In my target environment I found that the set of available cores is not limited (Cpus_allowed_list in /proc/self/status is the full range of cores) even if you are limited by the CPU quota to < 100% of 1 core. What should sysinfo report in this case? Should we add something like "effective number of cores" that is a float?

jonashaag avatar Aug 15 '23 10:08 jonashaag

@GuillaumeGomez

jonashaag avatar Sep 16 '23 16:09 jonashaag

I honestly have no idea. What are the other tools doing in such a situation?

GuillaumeGomez avatar Sep 17 '23 11:09 GuillaumeGomez