question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nbresuse reports total Jupyter server memory

See original GitHub issue

It looks like nbresuse is reporting the memory use for the entire server process, including all notebooks.

class MetricsHandler(IPythonHandler):
    def get(self):
        """
        Calculate and return current resource usage metrics
        """
        config = self.settings['nbresuse_display_config']
        cur_process = psutil.Process()
        all_processes = [cur_process] + cur_process.children(recursive=True)
        rss = sum([p.memory_info().rss for p in all_processes])

Is it possible to report memory use for each notebook individually? I don’t know anything about jupyter architecture, but maybe there’s a way to get a pointer to the calling notebook or PID?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mathematicalmichaelcommented, Dec 31, 2018

I mean, isn’t the total memory usage what you really care about, since bumping up against your system’s limits is what the concern is? I think one solution to get what you would like to see is to run dockerspawner through jupyterhub so that each notebook instance is in an isolated container. That way this extension should report the usage as a proportion of the total memory allocated to the container.

0reactions
jtpiocommented, Apr 27, 2020

@jkleint yes per notebook metrics would roughly correspond to per kernel metrics (although there can be multiple notebooks sharing the same kernel).

This is great feedback. Would you like to continue the conversation in https://github.com/yuvipanda/nbresuse/issues/31? (and maybe link to you comment or copy the content over there)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Doesn't display memory value on my jupyter notebook #17
I've got a multi-user environment using the jupyter notebook on a server. ... right now nbresuse is used as the default for reporting...
Read more >
Check your memory usage - The Littlest JupyterHub
It is shown in the top right corner of the notebook interface. Note that this is memory usage for everything your user is...
Read more >
nbresuse - PyPI
Simple Jupyter extension to show how much resources (RAM) your notebook is ... Currently the server extension only reports memory usage (just RSS)...
Read more >
Verifying the memory usage using nbresuse - Jupyter notebook
I have installed the Jupyter Extension nbresuse to verify memeory usage, but I struggle on how to display the memory limit (I can...
Read more >
jupyter-resource-usage Changelog - pyup.io
([Full Changelog](https://github.com/jupyter-server/jupyter-resource-usage/compare/jupyter-server/ ... Report the memory usage metrics as prometheus metrics ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found