python - Lowering process priority of multiprocessing.Pool on Windows -


i use multiprocessing.pool() parallelize heavy pandas processing find bit successful. cpu usage goes 100% , entire computer becomes unresponsive. mouse becomes difficult use.

i can change process priority of process code.

import psutil p = psutil.process(os.getpid()) p.nice = psutil.below_normal_priority_class 

however, when in windows task manager find main python.exe process has been changed below normal priority.

is there way reduce priority of pool processes?

you can try setting priority of process' children after spawned them. like:

import psutil  # spawn children and/or launch process pool here  parent = psutil.process() parent.nice(psutil.below_normal_priority_class) child in parent.children():     child.nice(psutil.below_normal_priority_class) 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -