Management Flags

You can remotely (and without taking offline the uWSGI server) modify the behaviour of the uWSGI stack.

Using the uwsgi protocol you can enable/disable/setup the internal options.

All the flags take an unsigned 32bit value (so the block size is always 4) that contain the value to set for the flag. If you do not specify this value (so you send only the uwsgi header) the server will count it as 0.

This is a table of flag available:

flagactionnote
0loggingenable/disable logging
1max_requestsset maximum number of requests per worker
2socket_timeoutmodify the internal socket timeout
3memory_debugenable/disable memory debug/report
4master_intervalset the master process check interval
5harakiriset/unset the harakiri timeout
6cgi_modeenable/disable cgi mode
7threadsenable/disable python threads
8reaperenable/disable process reaper

A simple (and ugly) script is included to remotly change management flags:

./uwsgi --no-server -w myadmin --pyargv "192.168.173.16 3031 0 0"

the command will disable logging on the uWSGI server listening on 192.168.173.16 port 3031

and

./uwsgi --no-server -w myadmin --pyargv "192.168.173.16 3031 0 1"

will re-enable it