fix: MySQL 空闲连接健康检查 + Gunicorn worker 保活,解决广播开才不卡

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-09 04:49:08 +08:00
parent 9e61161a5c
commit c4244ad423
4 changed files with 30 additions and 0 deletions

View File

@@ -16,6 +16,14 @@ sleep 2
systemctl is-active gunicorn-dianjing.service
pgrep -cf 'gunicorn.*a_long_dianjing' || true
echo ""
echo ">>> 安装 worker 保活 cron空闲后不卡"
chmod +x deploy/gunicorn-warmup.sh
cp deploy/gunicorn-warmup.cron /etc/cron.d/gunicorn-warmup
chmod 644 /etc/cron.d/gunicorn-warmup
bash deploy/gunicorn-warmup.sh
echo " cron 已安装每2分钟预热 worker"
echo ""
echo ">>> 最近慢请求 (rt>=0.5s):"
grep -a 'hqhd' "$NGINX_LOG" | awk 'match($0,/rt=([0-9.]+)/,a){if(a[1]+0>=0.5)print}' | tail -5