I am new to using Jupyter notebook. I have installed Jupyter using Anaconda and have set up a jupyter server. I wanted to control the cpu and memory available for Jupyter. Is there any configuration for doing that? What is the best way to achieve this.
Thanks
The default memory values in Jupyter are around 3.2GB in bytes. In order to calculate the amount of GB you need to bytes, you need to multiply your desired amount by 1073741824. For example, if you want to set it to 16GB, your value to be set would be 17179869184.
Importing “psutil” allows to get information about the current states of RAM and CPU usage. Using matplotlib in “notebook” mode allows to refresh plots inplace (refresh the plots which have already been showed).
Public Jupyter notebook may be running on a host machine. However, if you are creating your own Jupyter notebooks and running them in the usual way, then you probably are using your own CPUs, especially since, as you put it, "some very demanding cells in can vary from simple to double between the two computers."
You can specify CPU limit to Jupyter notebook process using
sudo cpulimit -l 100 -p <PID>
where PID is ID of your process, -l is for limit, you can read man page to learn how to use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With