What threads do Dask Workers have active?

你离开我真会死。 提交于 2020-01-11 10:07:54

问题


When running a Dask worker I notice that there are a few extra threads beyond what I was expecting. How many threads should I expect to see running from a Dask Worker and what are they doing?


回答1:


Dask workers have the following threads:

  • A pool of threads in which to run tasks. This is typically somewhere between 1 and the number of logical cores on the computer
  • One administrative thread to manage the event loop, communication over (non-blocking) sockets, responding to fast queries, the allocation of tasks onto worker threads, etc..
  • A couple of threads that are used for optional compression and (de)serialization of messages during communication
  • One thread to monitor and profile the two items above

Additionally, by default there is an additional Nanny process that watches the worker. This process has a couple of its own threads for administration.

These are internal details as of October 2018 and may change without notice.

People who run into "too many threads" issues often are running tasks that are themselves multi-threaded, and so get an N-squared threading issue. Often the solution here is to use environment variables like OMP_NUM_THREADS=1 but this depends on the exact libraries that you're using.



来源:https://stackoverflow.com/questions/52618436/what-threads-do-dask-workers-have-active

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!