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.

  • 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.


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

  • kwargs

Returns default log message format.


Some params may be missing.


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.

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

    WSGI application module path or filepath.

    mypackage.my_wsgi_module – read from application attr of mypackage/ mypackage.my_wsgi_module:my_app – read from my_app attr of mypackage/
  • 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