Preset: Nice

This preset offers nice configuration defaults.

class uwsgiconf.presets.nice.Section(name=None, touch_reload=None, workers=None, threads=None, mules=None, owner=None, log_into=None, log_dedicated=None, process_prefix=None, ignore_write_errors=None, **kwargs)

Basic nice configuration.

Parameters:
  • name (str|unicode) – Section name.
  • touch_reload (str|list) – Reload uWSGI if the specified file or directory is modified/touched.
  • workers (int) – Spawn the specified number of workers (processes). Default: workers number equals to CPU count.
  • threads (int|bool) – Number of threads per worker or True to enable user-made threads support.
  • mules (int) – Number of mules to spawn.
  • owner (str|unicode) – Set process owner user and group.
  • log_into (str|unicode) – Filepath or UDP address to send logs into.
  • log_dedicated (bool) – If True all logging will be handled with a separate thread in master process.
  • process_prefix (str|unicode) – Add prefix to process names.
  • ignore_write_errors (bool) –

    If True no annoying SIGPIPE/write/writev errors will be logged, and no related exceptions will be raised.

    Note

    Usually such errors could be seen on client connection cancelling and are safe to ignore.

  • kwargs
get_log_format_default()

Returns default log message format.

Note

Some params may be missing.

configure_owner(owner='www-data')

Shortcut to set process owner data.

Parameters:owner (str|unicode) – Sets user and group. Default: www-data.
class uwsgiconf.presets.nice.PythonSection(name=None, params_python=None, wsgi_module=None, wsgi_callable=None, embedded_plugins=True, require_app=True, threads=True, **kwargs)

Basic nice configuration using Python plugin.

Parameters:
  • name (str|unicode) – Section name.
  • params_python (dict) – See Python plugin basic params.
  • wsgi_module (str|unicode) –

    WSGI application module path or filepath.

    Example:
    mypackage.my_wsgi_module – read from application attr of mypackage/my_wsgi_module.py mypackage.my_wsgi_module:my_app – read from my_app attr of mypackage/my_wsgi_module.py
  • wsgi_callable (str|unicode|callable) – WSGI application callable name. Default: application.
  • embedded_plugins (bool|None) – This indicates whether plugins were embedded into uWSGI, which is the case if you have uWSGI from PyPI.
  • require_app (bool) – Exit if no app can be loaded.
  • threads (int|bool) – Number of threads per worker or True to enable user-made threads support.
  • kwargs