I'm working on a shared sandbox server running on Debian 3.16 , and i don't want to use all the CPU. So I've tried to limit the number of the processes by setting processes to 10. But it doesn't work, and it still uses all of avalaible CPU.
partial_run = functools.partial(function, **kwargs)
pool = multiprocessing.Pool(processes=10, maxtasksperchild=1)
res = pool.map(partial_run, product_set_list)
pool.close()
pool.join()
I think it's because I use numpy in the function, which performs operations outside the GIL. How can I limit the CPU usage?