-
Notifications
You must be signed in to change notification settings - Fork 3
/
server_config.py
66 lines (46 loc) · 1.84 KB
/
server_config.py
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
import gunicorn
# set the 'server' response header
gunicorn.SERVER_SOFTWARE = 'falcon_graphql_server'
# set the socket to bind on (use 0.0.0.0 for bare deploy)
# this can also be set programatically via the -b flag
bind = 'localhost:4004'
# set the maximum number of pending transactions before an error is returned
backlog = 8192
#set workers
workers = 2
# set threads (optimize for cores * 2-4?)
threads = 2
# set worker class ('sync' is good for normal workloads)
worker_class = 'sync'
# set maximum number of simultaneous client connections per worker process
worker_connections = 4096
# set lifetime of worker in requests before mandatory restart (prevent leaks)
max_requests = 40960
# add jitter to max_requests to avoid workers all stopping at the same time
max_requests_jitter = 7040
# set connection timeout for killing a worker (async jobs still communicate)
timeout = 30
# set time to finish services before restart when signal is received
graceful_timeout = 60
# set keepalive HTTP connection wait time for next request (in seconds)
keepalive = 2
# limit size (in bytes) of requests to guard against denial-of-service attacks
limit_request_line = 8192
# limit number of request header fields as an additional safeguard
limit_request_fields = 25
# Load application code before workers are forked (saves RAM & speeds up boot)
preload = True
# enable reload for automatic worker restarts on code changes during development
#reload = False
# enable spew for intense debugging in order to dump all executed code
#spew = True
# enable daemon to detach worked processes from terminal
#daemon = True
# set logging format and level ('debug', 'info', 'warning', 'error', 'critical')
errorlog = '-'
loglevel = 'info'
accesslog = '-'
access_log_format = '%(t)s %(s)s "%(r)s" %(L)s %(b)s'
access_log_file = None
# set process name
proc_name = 'falcon-graphql-gunicorn'