python - 在 jupyter/ipython notebook 中设置优先级/niceness

标签 python linux environment-variables ipython jupyter-notebook

有没有办法在笔记本中将 jupyter 笔记本的 CPU 优先级设置得较低?例如。在计算服务器上运行为期一天的参数搜索时,在该笔记本中设置优先级,使其落后于其他人实时处理的笔记本。

最佳答案

也许设置您的 python 进程的优先级对您来说就足够了? startet 进程尽可能继承优先级。 如果是,以下代码对我有帮助:

import psutil
psutil.Process().nice(19)# if on *ux
psutil.Process().nice(psutil.IDLE_PRIORITY_CLASS)# if on win

关于python - 在 jupyter/ipython notebook 中设置优先级/niceness,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47600569/

相关文章:

linux - 什么是私有(private)页面?

linux - 如何在 shell 变量中获取网页的内容?

c - 设置为空环境变量的其他包含目录会中断 Visual C++ 构建

python - 使用 pip freeze 忽略某些包及其依赖项

Python-字符串分割

python - C++(LAPACK、sgels)和Python(Numpy、lstsq)结果的区别

c++ - (SWIG C++ 到 Python)警告 301 : class keyword used, 但不是在 C++ 模式下

c++ - 在不退出程序的情况下使用警报(3)——C++

python - 如何在 conda 环境中使用 Jupyter notebooks?

node.js - 如何更改 node.js 中 process.env.PORT 的值?