-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgunicorn.conf.py
45 lines (30 loc) · 1.23 KB
/
gunicorn.conf.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
# import multiprocessing
# import sys
# import logging
bind = "0.0.0.0:5000" # Bind to all available network interfaces
####### =====
#######
# Redirect gunicorn logs to stdout
accesslog = "-"
errorlog = "-"
#loglevel = "info"
# capture_output = True
# logger_class = "gunicorn.glogging.Logger"
#logging.basicConfig(format="%(asctime)s [%(levelname)s] [%(name)s] %(message)s", stream=sys.stdout)
# workers = multiprocessing.cpu_count() * 2 + 1 # Use formula to determine the number of workers
# worker_class = "gthread" # Use threads for concurrency
# threads = multiprocessing.cpu_count() * 2 # Use twice as many threads as there are workers
# worker_connections = 1000 # Maximum number of simultaneous clients
# # Daemonize the process, detach from the terminal, and run in the background
# daemon = True
# pidfile = "/var/run/gunicorn.pid"
# # Set the user and group that the server will run as
# user = "nobody"
# group = "nogroup"
# # Set the maximum number of requests a worker will process before restarting
# max_requests = 1000
# max_requests_jitter = 50
# # Timeout for worker processes to gracefully finish execution
# timeout = 30
# # Enable pre-fork mode to avoid expensive process creation on each request
# preload_app = True