枪支访问其他工人的记忆
目前,我有一个交易机器人应用程序,该应用程序具有一个UI接口可以启动和停止当前运行bot。在后面还有一个机器人管理器,可以跟踪所有跑步机器人,并且具有启动和停止的能力。每个机器人都以其自己的线程启动,并且管理器必须可以访问多数民众联盟(为了在必要时停止)。目前,如果我指定更多的工人,则取决于我无法访问所需线程的请求降落的哪个工人。
目前,我在Docker中有一个枪支设置:
gunicorn app:application --worker-tmp-dir /dev/shm --bind 0.0.0.0:8000 --timeout 600 --workers 1 --threads 4
问题:
昨天,一个机器人停止了,因为显然Ganicorn耗尽了记忆,工人不得不重新启动在杀死跑步机器人的过程中。 (不能有)。这些机器人应在需要时能够持续数月。有没有办法修复或告诉枪支永远不要阻止工人或流程?或者,也许我应该使用其他Python服务器,例如女服务员或UWSGI ?
Currently I've got a trading bot application which has a UI interface to start and stop currently running bots. In behind there is also a bot manager, which keeps track of all running bots and has the ability to start and stop them. Each bot is started in its own thread and the manager must have access to thats thread memory (in order to stop it when necessary). Currently If i specify more workers then depending which worker the request lands on I've no access to the thread I need.
At this moment, I've got a gunicorn setup in docker:
gunicorn app:application --worker-tmp-dir /dev/shm --bind 0.0.0.0:8000 --timeout 600 --workers 1 --threads 4
The problem:
Yesterday one of the bots stopped because apparently gunicorn ran out of memory and the worker had to restart in the process killing running bot. (Can't have that). These bots should be able to run for months if needed. Is there a way to fix or tell gunicorn to never stop workers or processes? Or maybe I should use a different python server like waitress or uWSGI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论