1名工人的枪支最大线程

发布于 2025-01-24 20:04:37 字数 554 浏览 3 评论 0原文

用枪支工人和线程而言,我需要知道是否有最大线程可以分配给一个工人?我已经为交易机器人的UI部分提供了烧瓶应用程序。它的作用允许用户创建交易机器人的新实例,当创建新实例时,将其添加为新线程。有一个机器人管理器,允许以线程为单位停止和启动机器人实例,并跟踪运行线程。

应用程序已扩展。 Gunicorn在一个工人身上运行(因为工人在他们之间没有共享记忆,或者是机器人经理可以与其他工人交谈的方法?)。我可以从一个工人开始几个线程?我应该指定枪支的线程数吗?

目前,枪支被以下命令驱动:

gunicorn app:application --worker-tmp-dir /dev/shm --bind 0.0.0.0:8000 --timeout 600 --workers 1

我可以开始说一个单个工人的8个线程吗?它将获得什么好处?

gunicorn app:application --worker-tmp-dir /dev/shm --bind 0.0.0.0:8000 --timeout 600 --workers=1 --threads=8 

In terms if Gunicorn workers and threads I need to know if there is a maximum threads that can be assigned to a single worker? I've a flask application for the UI part of a trading bot. What it does it allows the user to create new instances of a trading bot and when a new instance is created, it is added as a new thread. There is a bot manager that allows to stop and start bot instances as threads and also keep track of running threads.

App is dockerized. Gunicorn runs on a single worker (since workers don't share memory between them, or is there a way for the bot manager to speak with other workers?). How many threads can I start on a single worker? Should I specify number of threads for gunicorn?

Currently gunicorn is fired up with following command:

gunicorn app:application --worker-tmp-dir /dev/shm --bind 0.0.0.0:8000 --timeout 600 --workers 1

Can I start lets say 8 threads on a single worker? What benefits will it reap?

gunicorn app:application --worker-tmp-dir /dev/shm --bind 0.0.0.0:8000 --timeout 600 --workers=1 --threads=8 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文