refactor: never restart local_model worker if LOCAL_MODEL_HOST_WORKER=1.

This commit is contained in:
liqiang-fit2cloud 2025-11-07 09:58:15 +08:00 committed by CaptainB
parent ed140743e2
commit 1600160f4f

View File

@ -27,13 +27,14 @@ class GunicornLocalModelService(BaseService):
log_format = '%(h)s %(t)s %(L)ss "%(r)s" %(s)s %(b)s '
bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}'
worker = CONFIG.get("LOCAL_MODEL_HOST_WORKER", 1)
max_requests = 10240 if worker > 1 else 0
cmd = [
'gunicorn', 'maxkb.wsgi:application',
'-b', bind,
'-k', 'gthread',
'--threads', '200',
'-w', str(worker),
'--max-requests', '10240',
'--max-requests', str(max_requests),
'--max-requests-jitter', '2048',
'--access-logformat', log_format,
'--access-logfile', '/dev/null',