Management Flags

Warning

This feature may be currently broken or deprecated.

You can modify the behavior of some aspects of the uWSGI stack remotely, without taking the server offline using the Management Flag system.

Note

A more comprehensive re-setup system may be in the works.

All the flags take an unsigned 32-bit value (so the block size is always 4) that contains the value to set for the flag.If you do not specify this value, only sending the uWSGI header, the server will count it as a read request.

FlagActionDescription
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 threads (currently unimplemented)
8reaperenable/disable process reaper
9log-zeroenable/disable logging of request with zero response size
10log-slowset/unset logging of slow requests
11log-4xxenable/disable logging of request with 4xx response status
12log-5xxenable/disable logging of request with 5xx response status
13log-bigset/unset logging of request with big response size
14log-sendfileset/unset logging of sendfile requests
15backlog-statusreport the current size of the backlog queue (linux on tcp only)
16backlog-errorsreport the number of errors in the backlog queue (linux on tcp only)

myadmin tool

A simple (and ugly) script, myadmin, is included to remotely change management flags:

  1. # disable logging on the uWSGI server listening on 192.168.173.17 port 3031
  2. ./uwsgi --no-server -w myadmin --pyargv "192.168.173.17:3031 0 0"
  3. # re-enable logging
  4. ./uwsgi --no-server -w myadmin --pyargv "192.168.173.17:3031 0 1"
  5. # read a value:
  6. ./uwsgi --no-server -w myadmin --pyargv "192.168.173.17:3031 15"