jupyterlab-system-monitor icon indicating copy to clipboard operation
jupyterlab-system-monitor copied to clipboard

Show cpu limit

Open jtpio opened this issue 5 years ago • 8 comments

The number of available cpus could be shown to the user as in a tooltip, or next to the percent value.

jtpio avatar Apr 09 '20 14:04 jtpio

i put the number of CPUs in the config, but the CPU display still shows 100% if only one of my cores goes to 100, is that as designed?

michaelaye avatar Apr 16 '20 02:04 michaelaye

The number of CPUs is not taken into account at the moment and is not displayed in the UI.

The value comes from nbresuse which uses psutil to retrieve the metrics:

  • https://github.com/yuvipanda/nbresuse/blob/dd2d21c0832cd7d8e41b91b2e8782e8eda11464b/nbresuse/init.py#L34
  • https://psutil.readthedocs.io/en/latest/#psutil.Process.cpu_percent

So yes the value can be greater than 100% but in that case it will be capped.

jtpio avatar Apr 16 '20 08:04 jtpio

Hello,

Which spawner does the toolbar support to display cpu metricts. We currently tried using this extension using a classical single user spawner but the cpu consumption is not shown and the memory does not look the same as the screenshot in the the readme :

image

we are using latest jupyterlab Version 2.1.1 in our tests.

Thanks !

fchiriac avatar Apr 24 '20 14:04 fchiriac

Most of the spawners should be supported, since the configuration is on the user notebook server.

For the CPU usage, is track_cpu_percent enabled? https://github.com/jtpio/jupyterlab-system-monitor#graphic-display

jtpio avatar Apr 27 '20 08:04 jtpio

Most of the spawners should be supported, since the configuration is on the user notebook server.

For the CPU usage, is track_cpu_percent enabled? https://github.com/jtpio/jupyterlab-system-monitor#graphic-display

hello, yes,

We are running latest Version 2.1.1 Jupyterlab

c.Spawner.cmd = ['jupyterhub-singleuser'] c.NotebookApp.ResourceUseDisplay.track_cpu_percent = True c.NotebookApp.ResourceUseDisplay.cpu_limit = 2

It is enabled but it does not display any cpu metrics, just the ram.

thanks Florin

fchiriac avatar Apr 27 '20 09:04 fchiriac

And with the following config?

c.Spawner.args = [
  "--ResourceUseDisplay.track_cpu_percent=True",
  "--ResourceUseDisplay.cpu_limit=2"
]

jtpio avatar Apr 27 '20 09:04 jtpio

And with the following config?

c.Spawner.args = [
  "--ResourceUseDisplay.track_cpu_percent=True",
  "--ResourceUseDisplay.cpu_limit=2"
]

yes, this seems to have done the trick :D thank you !

fchiriac avatar Apr 27 '20 10:04 fchiriac

Great!

Maybe we could add some documentation about using this with JupyterHub in the README? Otherwise another candidate would be the nbresuse repo.

jtpio avatar Apr 27 '20 10:04 jtpio

Closing as this would have to be implemented in https://github.com/jupyter-server/jupyter-resource-usage.

jtpio avatar Jul 26 '23 06:07 jtpio