perf: try to reduce memory usage by adding --preload argument for multi workers.

This commit is contained in:
liqiang-fit2cloud 2025-10-23 10:25:25 +08:00
parent c5aa570482
commit af5d0dcb9f
3 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,7 @@ class GunicornService(BaseService):
cmd = [
'gunicorn', 'maxkb.wsgi:application',
'-b', bind,
'--preload',
'-k', 'gthread',
'--threads', '200',
'-w', str(self.worker),

View File

@ -29,6 +29,7 @@ class GunicornLocalModelService(BaseService):
cmd = [
'gunicorn', 'maxkb.wsgi:application',
'-b', bind,
'--preload',
'-k', 'gthread',
'--threads', '200',
'-w', str(worker),

View File

@ -21,6 +21,7 @@ class SchedulerService(BaseService):
cmd = [
'gunicorn', 'maxkb.wsgi:application',
'-b', bind,
'--preload',
'-k', 'gthread',
'--threads', '200',
'-w', str(self.worker),