Skip to content

Commit af5d0dc

Browse files
perf: try to reduce memory usage by adding --preload argument for multi workers.
1 parent c5aa570 commit af5d0dc

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def cmd(self):
1919
cmd = [
2020
'gunicorn', 'maxkb.wsgi:application',
2121
'-b', bind,
22+
'--preload',
2223
'-k', 'gthread',
2324
'--threads', '200',
2425
'-w', str(self.worker),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def cmd(self):
2929
cmd = [
3030
'gunicorn', 'maxkb.wsgi:application',
3131
'-b', bind,
32+
'--preload',
3233
'-k', 'gthread',
3334
'--threads', '200',
3435
'-w', str(worker),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def cmd(self):
2121
cmd = [
2222
'gunicorn', 'maxkb.wsgi:application',
2323
'-b', bind,
24+
'--preload',
2425
'-k', 'gthread',
2526
'--threads', '200',
2627
'-w', str(self.worker),

0 commit comments

Comments
 (0)