Skip to content

Commit ea2c2f9

Browse files
refactor: never restart local_model worker if LOCAL_MODEL_HOST_WORKER=1.
1 parent ff570a3 commit ea2c2f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/common/management/commands/services/services/local_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ def cmd(self):
2727
log_format = '%(h)s %(t)s %(L)ss "%(r)s" %(s)s %(b)s '
2828
bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}'
2929
worker = CONFIG.get("LOCAL_MODEL_HOST_WORKER", 1)
30+
max_requests = 10240 if worker > 1 else 0
3031
cmd = [
3132
'gunicorn', 'maxkb.wsgi:application',
3233
'-b', bind,
3334
'-k', 'gthread',
3435
'--threads', '200',
3536
'-w', str(worker),
36-
'--max-requests', '10240',
37+
'--max-requests', str(max_requests),
3738
'--max-requests-jitter', '2048',
3839
'--access-logformat', log_format,
3940
'--access-logfile', '/dev/null',

0 commit comments

Comments
 (0)