diff --git a/apps/common/management/commands/services/services/local_model.py b/apps/common/management/commands/services/services/local_model.py index 4511f8f5f..c0e0c1fd3 100644 --- a/apps/common/management/commands/services/services/local_model.py +++ b/apps/common/management/commands/services/services/local_model.py @@ -24,12 +24,13 @@ class GunicornLocalModelService(BaseService): os.environ.setdefault('SERVER_NAME', 'local_model') 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) cmd = [ 'gunicorn', 'smartdoc.wsgi:application', '-b', bind, '-k', 'gthread', '--threads', '200', - '-w', "1", + '-w', worker, '--max-requests', '10240', '--max-requests-jitter', '2048', '--access-logformat', log_format, diff --git a/apps/smartdoc/conf.py b/apps/smartdoc/conf.py index de61cb8e3..cdbe441f9 100644 --- a/apps/smartdoc/conf.py +++ b/apps/smartdoc/conf.py @@ -93,7 +93,8 @@ class Config(dict): 'SANDBOX': False, 'LOCAL_MODEL_HOST': '127.0.0.1', 'LOCAL_MODEL_PORT': '11636', - 'LOCAL_MODEL_PROTOCOL': "http" + 'LOCAL_MODEL_PROTOCOL': "http", + 'LOCAL_MODEL_HOST_WORKER': 1 }