Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we configure the cpu and memory resources for Jupyter notebook

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

like image 633
Midhun Mathew Sunny Avatar asked Mar 22 '17 14:03

Midhun Mathew Sunny


People also ask

How do I assign more memory to my Jupyter notebook?

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.

How do I check my CPU in Jupyter notebook?

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).

Does Jupyter notebook use CPU?

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."


1 Answers

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.

like image 182
evaleria Avatar answered Oct 19 '22 12:10

evaleria