Skip to content

Commit

Permalink
Fixed #267: added documentation for wsgi env behaviour/behavior policies
Browse files Browse the repository at this point in the history
  • Loading branch information
shanx committed May 9, 2017
1 parent 0ec7219 commit 1af8b3f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Options.rst
Expand Up @@ -11981,8 +11981,9 @@ wsgi-env-behaviour

``parser``: uwsgi_opt_set_str

``help``: set the strategy for allocating/deallocating the WSGI env
``help``: set the strategy for allocating/deallocating the WSGI env, can be: "cheat" or "holy"

``reference``: :doc:`articles/WSGIEnvBehaviour`


wsgi-env-behavior
Expand All @@ -11991,9 +11992,9 @@ wsgi-env-behavior

``parser``: uwsgi_opt_set_str

``help``: set the strategy for allocating/deallocating the WSGI env

``help``: set the strategy for allocating/deallocating the WSGI env, can be: "cheat" or "holy"

``reference``: :doc:`articles/WSGIEnvBehaviour`

start_response-nodelay
**********************
Expand Down
2 changes: 1 addition & 1 deletion _options/optdefs.py
Expand Up @@ -571,7 +571,7 @@ def python_options():
s.o("py-tracebacker", str, "enable the uWSGI Python tracebacker")
s.o(("py-auto-reload", "py-autoreload", "python-auto-reload", "python-autoreload"), int, "Monitor Python modules' modification times to trigger reload (use only in development)")
s.o("py-auto-reload-ignore", [str], "ignore the specified module during auto-reload scan")
s.o(("wsgi-env-behaviour", "wsgi-env-behavior"), str, "set the strategy for allocating/deallocating the WSGI env")
s.o(("wsgi-env-behaviour", "wsgi-env-behavior"), str, "set the strategy for allocating/deallocating the WSGI env, can be: \"cheat\" or \"holy\"")
s.o("start_response-nodelay", True, "send WSGI http headers as soon as possible (PEP violation)")
s.o("python-version", True, "report python version")
return config
Expand Down
10 changes: 10 additions & 0 deletions articles/WSGIEnvBehaviour.rst
@@ -0,0 +1,10 @@
WSGI env behaviour policies
===========================

When using uWSGI two different strategies can be used for allocating/deallocating the WSGI env using either the
``wsgi-env-behaviour`` or ``wsgi-env-behavior`` option:

``cheat``: it preallocates the env dictionary on uWSGI startup and clears it after each request.
This is the default behaviour in uWSGI<=2.0.x

``holy``: creates and destroys the environ dictionary at each request. This is the default behaviour in uWSGI>=2.1
1 change: 1 addition & 0 deletions index.rst
Expand Up @@ -112,6 +112,7 @@ Articles
articles/TheArtOfGracefulReloading
articles/FunWithPerlEyetoyRaspberrypi
articles/OffloadingWebsocketsAndSSE
articles/WSGIEnvBehaviour



Expand Down

0 comments on commit 1af8b3f

Please sign in to comment.