This repository was archived by the owner on Jul 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathuwsgi.cfg
More file actions
115 lines (93 loc) · 2.97 KB
/
uwsgi.cfg
File metadata and controls
115 lines (93 loc) · 2.97 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
##############################################################################
# Buildout to install uwsgi https://github.com/unbit/uwsgi
#
# requires:
#
# - bin/adhocracpy-env to set the PYTHONPATH variable
#
##############################################################################
[buildout]
parts +=
uwsgi
uwsgi_bin
adhocracy-supervisor =
45 adhocracy (environment=${supervisor:environment} stopsignal=INT redirect_stderr=true stdout_logfile=var/log/adhocracy.log stderr_logfile=NONE) ${buildout:bin-directory}/uwsgi [--ini-paste ${buildout:directory}/etc/adhocracy.ini]
##############################################################################
# System settings
##############################################################################
[domains]
uwsgi = 127.0.0.1
[ports]
uwsgi = 5008
[urls]
uwsgi = http://projects.unbit.it/downloads/uwsgi-1.9.12.tar.gz
###############################
# Install and configure uwsgi #
###############################
# compile options
[uwsgi_build_conf]
recipe = collective.recipe.template
output = ${buildout:etc-directory}/uwsgi_buildconf.ini
input = ${buildout:etc-directory}/uwsgi_buildconf.ini.in
bin-name = ${buildout:bin-directory}/uwsgi
plugin-dir = ${buildout:var-directory}/uwsgi_plugins
main-plugin = python, gevent
[uwsgi_build_env]
UWSGI_PROFILE = ${uwsgi_build_profile:output}
PYTHONHOME = ${buildout:directory}
# compile egg
[uwsgi]
recipe = minitage.recipe.du
url = ${urls:uwsgi}
eggs =
${buildout:eggs}
uwsgi
environment = uwsgi_build_env
# uwsgi bin
[uwsgi_bin]
recipe = collective.recipe.template
output = ${buildout:bin-directory}/uwsgi
input = inline:
#!/bin/bash
source ${adhocpy:env-file}
${buildout:parts-directory}/uwsgi/bin/uwsgi "$@"
mode = 755
# configure
[uwsgi_conf]
conf =
#basics
http = ${adhocracy:host}:${ports:main}
pidfile = ${buildout:directory}/var/uwsgi.pid
master = true
chdir = ${buildout:directory}/src
home = ${buildout:directory}
# extended
# Reload if ini changes
touch-reload = true
# stop uwsgi if the wsgi app is not available
need-app = true
# allow threads
enable-threads = true
#Set close-on-exec on sockets (could be required for spawning processes in requests).
close-on-exec = true
#Automatically kill workers if master dies (can be dangerous for availability).
no-orphans = true
# Try to remove all of the generated files/sockets (UNIX sockets and pidfiles) upon exit.
vacuum = true
#performance tuning
processes = 1
worker = 20
post-buffering = 4096
max-requests = 1000
# Reload a worker if its address space usage is higher than the specified value (in megabytes).
reload-on-as = 128
#gracefull dead
harakiri = 60
harakiri-verbose = true
#logging
log-date = true
log-slow = true
# debug
# IPDB(); opens python shell
shared-import = ${buildout:directory}/scripts/interact.py
# memory-report = true