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
Post a Comment