Browse code

Keystone uwsgi set lazy-apps=true

Keystone had a problem where there was a memcached socket
opened very early on startup which then got shared between
worker processes when running under uwsgi. This can be
prevented by setting lazy-apps so this is the recommended
setting.

See http://uwsgi-docs.readthedocs.io/en/latest/ThingsToKnow.html

"""uWSGI tries to (ab)use the Copy On Write semantics of the
fork() call whenever possible. By default it will fork after
having loaded your applications to share as much of their
memory as possible. If this behavior is undesirable for some
reason, use the lazy-apps option. This will instruct uWSGI to
load the applications after each worker’s fork(). Beware as
there is an older options named lazy that is way more invasive
and highly discouraged (it is still here only for backward
compatibility) """

Change-Id: I6f271dc906528f0c86060452deaf15df81b267d2
Related-Bug: 1600394

Brant Knudson authored on 2016/09/01 05:47:56
Showing 1 changed files
... ...
@@ -338,6 +338,8 @@ function configure_keystone {
338 338
             iniset "$file" uwsgi buffer-size 65535
339 339
             # Make sure the client doesn't try to re-use the connection.
340 340
             iniset "$file" uwsgi add-header "Connection: close"
341
+            # This ensures that file descriptors aren't shared between processes.
342
+            iniset "$file" uwsgi lazy-apps true
341 343
         done
342 344
     fi
343 345