zulip/docs
Alex Vandiver 6218ed91c2 puppet: Use lazy-apps and uwsgi control sockets for rolling reloads.
Restarting the uwsgi processes by way of supervisor opens a window
during which nginx 502's all responses.  uwsgi has a configuration
called "chain reloading" which allows for rolling restart of the uwsgi
processes, such that only one process at once in unavailable; see
uwsgi documentation ([1]).

The tradeoff is that this requires that the uwsgi processes load the
libraries after forking, rather than before ("lazy apps"); in theory
this can lead to larger memory footprints, since they are not shared.
In practice, as Django defers much of the loading, this is not as much
of an issue.  In a very basic test of memory consumption (measured by
total memory - free - caches - buffers; 6 uwsgi workers), both
immediately after restarting Django, and after requesting `/` 60 times
with 6 concurrent requests:

                      |  Non-lazy  |  Lazy app  | Difference
    ------------------+------------+------------+-------------
    Fresh             |  2,827,216 |  2,870,480 |   +43,264
    After 60 requests |  3,332,284 |  3,409,608 |   +77,324
    ..................|............|............|.............
    Difference        |   +505,068 |   +539,128 |   +34,060

That is, "lazy app" loading increased the footprint pre-requests by
43MB, and after 60 requests grew the memory footprint by 539MB, as
opposed to non-lazy loading, which grew it by 505MB.  Using wsgi "lazy
app" loading does increase the memory footprint, but not by a large
percentage.

The other effect is that processes may be served by either old or new
code during the restart window.  This may cause transient failures
when new frontend code talks to old backend code.

Enable chain-reloading during graceful, puppetless restarts, but only
if enabled via a zulip.conf configuration flag.

Fixes #2559.

[1]: https://uwsgi-docs.readthedocs.io/en/latest/articles/TheArtOfGracefulReloading.html#chain-reloading-lazy-apps
2022-01-05 14:48:52 -08:00
..
_static readthedocs: Add proper backlink to the Zulip homepage. 2021-07-06 10:59:59 -07:00
_templates docs: Follow Sphinx 4 rename of master_doc to root_doc. 2021-08-31 14:24:16 -07:00
contributing external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
development setup-advanced: Remove misleading python3 symlink suggestion. 2021-12-16 17:30:04 -08:00
documentation documentation: Expand documentation processes in new feature tutorial. 2021-11-02 14:03:34 -07:00
git dev docs: Update Tig link. 2021-11-30 14:36:29 -08:00
images docs: Add missing width to Zulip logo. 2021-02-05 09:49:33 -08:00
overview webhooks: Remove space from UptimeRobot. 2021-12-22 14:05:17 -08:00
production puppet: Use lazy-apps and uwsgi control sockets for rolling reloads. 2022-01-05 14:48:52 -08:00
subsystems docs: Fix a few typos in documentation. 2021-12-28 09:36:59 -08:00
testing external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
translating external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
tutorials external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
.gitignore gitignore: Anchor patterns that should be anchored. 2017-07-19 14:03:49 -07:00
code-of-conduct.md repository: Add CODE_OF_CONDUCT.md. 2017-06-14 18:43:08 -07:00
conf.py docs: Enable sphinx_rtd_theme as an extension. 2021-11-04 11:55:15 -07:00
index.md external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
Makefile docs: Replace Makefile based on output of newer sphinx-quickstart. 2019-12-02 18:39:33 -08:00
README.md docs: Capitalize Markdown consistently. 2020-08-11 10:23:06 -07:00
requirements.readthedocs.txt requirements: Rename requirements files. 2017-11-21 02:38:26 +05:30
THIRDPARTY nagios: Replace check_website_response with standard check_http plugin. 2021-07-09 16:47:03 -07:00

Zulip Markdown documentation hosted elsewhere

The Markdown files in this directory ( /zulip/docs ) are not intended to be read on GitHub. Instead, visit our ReadTheDocs to read the Zulip documentation.