diff --git a/cli.sh b/cli.sh index 9c9d89015..a218a395b 100755 --- a/cli.sh +++ b/cli.sh @@ -60,7 +60,7 @@ mw_start_debug(){ if [ -f ${DIR}/data/port.pl ];then port=$(cat ${DIR}/data/port.pl) fi - cd ${DIR}/web && gunicorn -b :${port} -k eventlet -w 1 app:app + cd ${DIR}/web && gunicorn -b :${port} -k gthread -w 1 app:app # cd ${DIR}/web && gunicorn -b :${port} -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 app:app } @@ -69,7 +69,7 @@ mw_start_panel(){ if [ -f ${DIR}/data/port.pl ];then port=$(cat ${DIR}/data/port.pl) fi - cd ${DIR}/web && gunicorn -b :${port} -k eventlet -w 1 app:app + cd ${DIR}/web && gunicorn -b :${port} -k gthread -w 1 app:app # cd ${DIR}/web && gunicorn -b :${port} -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 app:app } diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index b5abb9868..722242d57 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -11,6 +11,9 @@ export PATH # curl -I -H "Accept-Encoding: zstd" http://localhost # curl --http3 -v https://www.xxx.com +# apt install ncat -y +# nc -u -v www.xxmhaa.com 443 + # cd /www/server/mdserver-web && python3 plugins/openresty/index.py run_info curPath=`pwd` diff --git a/requirements.txt b/requirements.txt index 4361dd180..624dcf79b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ flask-caching>=1.10.1 cache==1.0.3 gevent>=22.10.2 gevent-websocket==0.10.1 -eventlet>=0.24.1 + psutil==5.9.1 chardet==3.0.4 SQLAlchemy>=1.4.54 diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 57a502216..172393214 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -474,7 +474,7 @@ mw_debug(){ cd ${PANEL_DIR}/web fi # gunicorn -b :$port -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 app:app - gunicorn -b :$port -k eventlet -w 1 app:app + gunicorn -b :$port -k gthread -w 1 app:app } mw_connect_mysql(){ diff --git a/web/admin/__init__.py b/web/admin/__init__.py index 8993de6b0..9a188c02b 100644 --- a/web/admin/__init__.py +++ b/web/admin/__init__.py @@ -48,6 +48,8 @@ app = Flask(__name__, template_folder='templates/default') # curl --compressed -I "http://127.0.0.1:44010/" -H "Accept-Encoding: zstd" --write-out "%{json}" app.config["COMPRESS_ALGORITHM"] = ["zstd", "br", "gzip", "deflate"] +app.config["COMPRESS_LEVEL"] = 9 # 最高压缩级别 +app.config["COMPRESS_MIN_SIZE"] = 500 # 最小压缩大小 Compress(app) # 缓存配置 diff --git a/web/setting.py b/web/setting.py index 354ff20c8..5d92768eb 100755 --- a/web/setting.py +++ b/web/setting.py @@ -12,8 +12,7 @@ # 配置文件 # --------------------------------------------------------------------------------- -import eventlet -eventlet.monkey_patch() + import time import sys @@ -81,7 +80,7 @@ backlog = 512 reload = False daemon = True # # worker_class = 'geventwebsocket.gunicorn.workers.GeventWebSocketWorker' -worker_class = 'eventlet' +worker_class = 'gthread' timeout = 600 keepalive = 60 preload_app = False