Skip to content

Commit

Permalink
Docs about uwsgi processing model
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky committed Aug 10, 2023
1 parent e7fc5af commit 384f357
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@
1. uWSGI 相关配置文件:`cp conf/systemd/[email protected] /etc/systemd/system/`, `cp conf/logrotate/uwsgi /etc/logrotate.d/`, `systemctl daemon-reload`, `systemctl enable --now [email protected]`
1. Nginx 配置文件:`cp conf/nginx-sites/hackergame /etc/nginx/sites-available/hackergame``ln -s /etc/nginx/sites-available/hackergame /etc/nginx/sites-enabled/hackergame``systemctl reload nginx`

### uWSGI 运行情况检查
### uWSGI 运行模型

我们配置了 uWSGI 支持以下两种方式:

- prefork 模式,每个连接占用一个进程;
- gevent 模式,单进程,每个连接占用一个 gevent 绿色线程。

由于部分请求比较耗时(socket 相关的代码,例如 OAuth),prefork 在部分场景下无法提供足够的并发,因此 `conf/uwsgi-apps` 下默认为 gevent 模式。如果不希望使用 gevent,可将相关配置中 `gevent` 开头的配置注释,并将 `processes` 取消注释。

另外,如果需要使用 Debian 自带的 uWSGI 与 gevent plugin 等相关设施(包括 init 服务和 logrotate 配置,而非 pip 与本仓库的配置),需要取消注释 `plugin` 项。

#### 运行情况检查

可以使用 [`uwsgitop`](https://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html#uwsgitop) 来查看 uWSGI 运行情况。

Expand Down

0 comments on commit 384f357

Please sign in to comment.