-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathstart.py
46 lines (34 loc) · 866 Bytes
/
start.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time :
# @Author : Weiqiang.long
# @Site :
# @File : start.py
# @Software: PyCharm
# @Description:
# import requests
import os
import platform
import gevent.monkey
import multiprocessing
gevent.monkey.patch_all()
debug = True
loglevel = 'deubg'
# 服务地址(adderes:port)
bind = '0.0.0.0:5000'
if platform.system() == 'Windows':
# win机器路径
log_path = os.path.join(os.path.dirname(__file__), 'log')
else:
# 服务器路径
log_path = '/log'
# print(log_path)
pidfile = log_path + '/gunicorn.pid'
logfile = log_path + '/debug.log'
# 启动的进程数(获取服务器的cpu核心数*2+1)
workers = multiprocessing.cpu_count() * 2 +1
worker_class = 'gunicorn.workers.ggevent.GeventWorker'
threads = 20
preload_app = True
reload = True
x_forwarded_for_header = 'X-FORWARDED-FOR'