Skip to content

Properly configure mod_wsgi #16

@Wtower

Description

@Wtower

Current configuration for mod_wsgi is embedded #10 .

Add the following options in vhost.conf for WSGIDaemonProcess:

processes

Use only if relevant options is specified: the default implies single-process (not the same as specifying explicitly 1, which implies multi-process with 1 process).

threads

Add option. It is recommended to start with 3-5 for a small site. It depends on the cores and if the requests are CPU or I/O intensive. Shouldn't go more than 25.

inactivity-timeout

Add option to allow smaller sites process restart and reduce memory. 300 sec is a reasonable period. Don't set too low and watch new relic requests chart.

Other options

Other options for the future include restart-interval and/or maximum-requests to force restart of process. Use to prevent memory leaks for busier sites. Use in combination with graceful-timeout.

Also queue-timeout is interesting to ignore long queued requests in case of traffic outburst.

SSL

Use WSGIProcessGroup only in the 2nd vhost.conf for SSL (see the bottom of the documentation).

Monitor

Measure the memory footprint after launching the daemon and after running some requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions