This commit is contained in:
ZhymabekRoman 2024-02-23 14:41:33 +06:00
parent 71356aa9c8
commit ecbe4b46ca
3 changed files with 7 additions and 4 deletions

View file

@ -43,6 +43,7 @@ services:
timeout: 80s timeout: 80s
retries: 3 retries: 3
restart: always restart: always
mem_limit: 2g
dragonfly: dragonfly:
image: 'docker.dragonflydb.io/dragonflydb/dragonfly' image: 'docker.dragonflydb.io/dragonflydb/dragonfly'

View file

@ -44,6 +44,7 @@ services:
timeout: 80s timeout: 80s
retries: 3 retries: 3
restart: always restart: always
mem_limit: 2g
dragonfly: dragonfly:
image: 'docker.dragonflydb.io/dragonflydb/dragonfly' image: 'docker.dragonflydb.io/dragonflydb/dragonfly'

View file

@ -51,10 +51,11 @@ def worker_abort(worker):
@trace @trace
def number_of_workers(): def number_of_workers():
cores = multiprocessing.cpu_count() cores = multiprocessing.cpu_count()
if cores >= 8: workers = cores
workers = cores # if cores >= 8:
else: # workers = cores
workers = cores * 2 # else:
# workers = cores * 2
# workers = (cores * 2) + 2 # workers = (cores * 2) + 2
logger.debug(f"Number of workers: {workers}") logger.debug(f"Number of workers: {workers}")
return workers return workers