From 1b0be684bf09d97f84475bb25b711412753fe33d Mon Sep 17 00:00:00 2001 From: Mohammadreza Alihoseiny Date: Tue, 30 Aug 2022 09:06:22 +0430 Subject: [PATCH 1/2] Add more information about how to use port range - We need to enable threading on uWSGI for using port range option. Otherwise, the app will not work as expected because HTTP servers threads will not running as expected. The information about how you can enable threads add to the exports documentation. --- documentation/exports.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/exports.md b/documentation/exports.md index 21152e89..4a88a464 100644 --- a/documentation/exports.md +++ b/documentation/exports.md @@ -81,6 +81,8 @@ uWSGI and Gunicorn typically load the application into the master process before Set the [lazy-apps option](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#lazy-apps) to `true` (uWSGI) or the [preload-app option](https://docs.gunicorn.org/en/stable/settings.html#preload-app) to `false` (Gunicorn) to change this behaviour. +For using port ranges on uWSGI, you should also set the [enable-threads](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#enable-threads) to `true`. HTTP servers of different ports start on their own +threads and without that option, threads will not run. (Having the [threads](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#threads) will automatically enable that flag.) ## Exporting /metrics in a WSGI application with multiple processes globally From 15e6c4642af550050f581352730301ad09a14595 Mon Sep 17 00:00:00 2001 From: Mohammadreza Alihoseiny Date: Tue, 30 Aug 2022 09:10:46 +0430 Subject: [PATCH 2/2] Add blank line before threading guide --- documentation/exports.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/exports.md b/documentation/exports.md index 4a88a464..c6de777a 100644 --- a/documentation/exports.md +++ b/documentation/exports.md @@ -81,6 +81,7 @@ uWSGI and Gunicorn typically load the application into the master process before Set the [lazy-apps option](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#lazy-apps) to `true` (uWSGI) or the [preload-app option](https://docs.gunicorn.org/en/stable/settings.html#preload-app) to `false` (Gunicorn) to change this behaviour. + For using port ranges on uWSGI, you should also set the [enable-threads](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#enable-threads) to `true`. HTTP servers of different ports start on their own threads and without that option, threads will not run. (Having the [threads](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#threads) will automatically enable that flag.)