Helpful default config
sethk opened this issue · 2 comments
I think it would be helpful to have this default config for the README. I don't know how cross-platform the keys for os.sysconf
are, but it works on at least Linux and macOS Catalina.
import os
c = get_config()
# memory
c.NotebookApp.ResourceUseDisplay.mem_limit = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
# cpu
c.NotebookApp.ResourceUseDisplay.track_cpu_percent = True
c.NotebookApp.ResourceUseDisplay.cpu_limit = os.cpu_count()
Thanks @sethk for the suggestion.
According to the documentation it looks like os.sysconf
is only available on Unix: https://docs.python.org/3/library/os.html#os.sysconf
Maybe this could still be added to the README mentioning this is for Unix users? If so would you like to open a PR?
Closing as jupyterlab-system-monitor
has now been integrated in jupyter-resource-usage
: jupyter-server/jupyter-resource-usage#191
Feel free to open a new issue on the jupyter-resource-usage
repo if needed: https://github.com/jupyter-server/jupyter-resource-usage
Thanks!