File: uwsgi.rst

package info (click to toggle)
aodh 20.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,936 kB
  • sloc: python: 11,347; sh: 316; makefile: 206
file content (62 lines) | stat: -rw-r--r-- 1,808 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
=============================
Installing the API with uwsgi
=============================

Aodh comes with a few example files for configuring the API
service to run behind Apache with ``mod_wsgi``.

app.wsgi
========

The file ``aodh/api/app.wsgi`` sets up the V2 API WSGI
application. The file is installed with the rest of the Aodh
application code, and should not need to be modified.

Example of uwsgi configuration file
===================================


Create aodh-uwsgi.ini file::

    [uwsgi]
    http = 0.0.0.0:8041
    wsgi-file = <path_to_aodh>/aodh/api/app.wsgi
    plugins = python
    # This is running standalone
    master = true
    # Set die-on-term & exit-on-reload so that uwsgi shuts down
    exit-on-reload = true
    die-on-term = true
    # uwsgi recommends this to prevent thundering herd on accept.
    thunder-lock = true
    # Override the default size for headers from the 4k default. (mainly for keystone token)
    buffer-size = 65535
    enable-threads = true
    # Set the number of threads usually with the returns of command nproc
    threads = 8
    # Make sure the client doesn't try to re-use the connection.
    add-header = Connection: close
    # Set uid and gip to an appropriate user on your server. In many
    # installations ``aodh`` will be correct.
    uid = aodh
    gid = aodh

Then start the uwsgi server::

    uwsgi ./aodh-uwsgi.ini

Or start in background with::

    uwsgi -d ./aodh-uwsgi.ini

Configuring with uwsgi-plugin-python on Debian/Ubuntu
=====================================================

Install the Python plugin for uwsgi:

    apt-get install uwsgi-plugin-python

Run the server:

    uwsgi_python --master --die-on-term --logto /var/log/aodh/aodh-api.log \
        --http-socket :8042 --wsgi-file /usr/share/aodh-common/app.wsgi