Platform¶
Platform object is available in uwsgi module attribute:
_Platform¶
Attributes¶
apps_map¶
Applications dictionary mapping mountpoints to application callables.
buffer_size¶
The current configured buffer size in bytes.
clock ¶
Returns uWSGI clock microseconds.
config ¶
The current configuration options, including any custom placeholders.
config_variables ¶
Current mapping of configuration file "magic" variables.
cores_count¶
Detected number of processor cores.
hostname ¶
Current host name.
master_pid ¶
Return the process identifier (PID) of the uWSGI master process.
memory ¶
Returns memory usage tuple of ints: (rss, vsz).
postfork_hooks¶
uWSGI is a preforking server, so you might need to execute a fixup tasks (hooks) after each fork(). Each hook will be executed in sequence on each process (worker/mule).
Note
The fork() happen before app loading, so there's no hooks for dynamic apps.
But one can still move postfork hooks in a .py file and
import it on server startup with python.import_module().
ready_for_requests ¶
Returns flag indicating whether we are ready to handle requests.
request¶
started_on¶
uWSGI's startup Unix timestamp.
threads_enabled¶
Flag indicating whether thread support is enabled.
worker_id ¶
Returns current worker ID. 0 if not a worker (e.g. mule).
workers_count¶
Number of workers (processes) currently running.
workers_info ¶
Gets statistics for all the workers for the current server.
Returns tuple of dicts.
Functions¶
get_listen_queue¶
- Socket number.
Returns listen queue (backlog size) of the given socket.
ValueError If socket is not found
get_version¶
Returns uWSGI version string or tuple.
_Request¶
Current request information.
Attributes¶
content_length ¶
Returns current post content length.
env ¶
Request environment dictionary.
fd ¶
Returns current request file descriptor.
id ¶
Returns current request number (handled by worker on core).
total_count ¶
Returns the total number of requests managed so far by the pool of uWSGI workers.
Functions¶
add_var¶
Registers custom request variable.
Can be used for better integration with the internal routing subsystem.
ValueError If buffer size is not enough.
log¶
Instructs uWSGI to log current request data.