Python tornado with multi-process

岁酱吖の 提交于 2019-12-04 15:14:41

In general, when using multi-process mode the processes only communicate via external services: databases, cache servers, message queues, etc. There are some additional options available for processes that are running on the same machine (see the multiprocessing module`), but in general once you are no longer using a single process it's better to look to techniques that will continue to scale when you move beyond a single machine.

In this scenario, it is the kernel and not Tornado that does the load balancing across the processes. In theory, this is a self-correcting mechanism because the new connection will only be given to a process that is idle at the time the connection arrives. However, in practice this tends to result in significant imbalances (the most loaded process has 2-3x as many connections as the least loaded), so a dedicated load balancing proxy will result in a more even distribution.

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