zulip/zproject
Alex Vandiver eef65d7e30 uwsgi: Force Django load before returning the uwsgi worker function.
Django lazy-loads much of its modules, including the application's.
This defers the time to during the first request it serves.  When
doing rolling-restarts, this means that the worker is marked "ready"
despite having multiple seconds more work to do.  With small numbers
of workers, this causes a significant capacity drop, since effectively
more than one worker can be still reloading at a time.  It also
results in poor user experience for the requests which are unlucky
enough to be served first.

Use the technique detailed in the uwsgi documentation[^1] to fake a
request during initial application load, which forces the application
to be loaded.

[^1]: https://uwsgi-docs.readthedocs.io/en/latest/articles/TheArtOfGracefulReloading.html#dealing-with-ultra-lazy-apps-like-django
2024-08-25 15:43:50 -07:00
..
jinja2 realm-deactivation: Send email to owners as part of deactivation. 2024-06-26 16:48:18 -07:00
__init__.py
backends.py auth: Update AzureADAuthBackend to use the newer Microsoft API. 2024-08-21 16:16:30 -07:00
computed_settings.py saml: Add support for syncing user role. 2024-08-20 11:53:24 -07:00
config.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
configured_settings.py settings: Print about custom settings from runtornado. 2023-12-05 12:33:34 -08:00
default_settings.py saml: Add support for syncing user role. 2024-08-20 11:53:24 -07:00
dev_settings.py settings: Disable KaTeX server in development. 2024-07-17 17:58:32 -07:00
dev_urls.py dev_urls: Make requests to /docs redirect to the index. 2024-03-21 11:27:14 -07:00
email_backends.py ruff: Fix UP035 Import from `collections.abc`, `typing` instead. 2024-07-13 22:28:22 -07:00
prod_settings.pyi lint: Replace pycodestyle and pyflakes with ruff. 2022-11-03 12:10:15 -07:00
prod_settings_template.py saml: Add support for syncing user role. 2024-08-20 11:53:24 -07:00
sentry.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
settings.py settings: Hide django_stubs_ext from mypy. 2024-04-17 16:49:03 -07:00
settings_types.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
template_loaders.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
test_extra_settings.py tests: Default ENABLE_FILE_LINKS to False. 2024-07-18 13:50:28 -07:00
test_settings.py settings: Refactor how TEST_SUITE is configured. 2023-12-04 09:50:14 -08:00
urls.py user_profile: Remove 'tutorial_status' field. 2024-08-15 13:31:40 -07:00
wsgi.py uwsgi: Force Django load before returning the uwsgi worker function. 2024-08-25 15:43:50 -07:00