-
Notifications
You must be signed in to change notification settings - Fork 16
/
uwsgi
executable file
·52 lines (44 loc) · 978 Bytes
/
uwsgi
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
#!/bin/sh
set -e
SOCKET="0.0.0.0:80"
USAGE="Usage: $0 [-h] [-d] [-s <SOCKET>]
Start uwsgi
Options:
-h Show this help message and exit.
-d Run uwsgi with single worker for debug purposes.
-s <SOCKET> IP:Port where uwsgi should listen to, defaults to $SOCKET.
"
while getopts ":hds:" opt; do
case "$opt" in
h)
echo "$USAGE"
exit
;;
d)
DEBUG=1
;;
s)
SOCKET=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
echo "$USAGE" >&2
exit 1
esac
done
if [ -z "$DEBUG" ]; then
ARGS="--cheaper-algo spare
--cheaper 8
--cheaper-initial 8
--cheaper-step 2
--cheaper-overload 1
--workers 32"
else
ARGS="--workers 1"
fi
set -x
exec uwsgi \
--paste-logger \
--http-socket $SOCKET \
--ini-paste uwsgi.ini \
$ARGS