Home › Forums › KX Solutions › Run Jupyterq notebook with limit CPU cores › Reply To: Run Jupyterq notebook with limit CPU cores
-
You could start Jupyter with a core restriction:
taskset -c 0-15 jupyter notebook
Or see this answer I posted previously: (you could choose 0-15 rather than 0,1)
https://stackoverflow.com/a/77481466/4256419
Edit the file https://github.com/KxSystems/jupyterq/blob/master/kernelspec/kernel.json
{ "argv": [ "taskset", "-c", "0,1", "q", "jupyterq_kernel.q", "-cds", "{connection_file}" ], "display_name": "Q (kdb+)", "language": "q", "env": {"JUPYTERQ_SERVERARGS":"","MPLBACKEND":"Agg"} }
If you have already installed you can ensure Jupyter picks up the changes by reinstalling the kernel:
python -m jupyter kernelspec install --user --name=qpk /path/to/kernelspec
And you can validate in a notebook with
system"taskset -pc ",string .z.i