My server runs many long running notebooks, and I'd like to monitor the notebooks memory.
Is there a way to match between the pid or process name and a notebook?
My server runs many long running notebooks, and I'd like to monitor the notebooks memory.
Is there a way to match between the pid or process name and a notebook?
This is possible, although I could only think of the rather hackish solution I outline below. In summary:
security
directorynetstat
to determine which pid is listening to the ports found in step 1I suspect there is a much simpler way, but I'm not sure as yet where to find it.
outputs (for me, at the moment):
Since the question is about monitoring notebooks' memory, I've written a complete example showing the memory consumption of the running notebooks. It is based on the excellent @jcb91 answer and a few other answers (1, 2, 3, 4).
Here is an example output of
show_notebooks_table('localhost', 8888)
:Adding to the Dennis Golomazov's answer to:
I replaced the get_running_notebooks function by this one (source):