Skip to content

Commit

Permalink
Make things more clear using Celery workers
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack committed Mar 19, 2024
1 parent 9b9af31 commit fd9cfe6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions compose/rabbitmq/rabbitmq.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ listeners.tcp.default = 5672
management.tcp.port = 15672

# Extend the consumer timeout (the default is 30 minutes) as otherwise workers get killed
# that take longer to acknowledge a task. But in our case this is mostly the case as
# other (maybe higher priortized) analysis tasks are before them in the queue or the
# analysis task was scheduled.
# that take longer to acknowledge a task. This timeout starts when a task is fetched
# by a worker. A worker can fetch multiple tasks which can be configured by
# CELERY_WORKER_PREFETCH_MULTIPLIER in our settings file.
# https://www.rabbitmq.com/consumers.html#acknowledgement-timeout
consumer_timeout = 604800000 # 1 weeks
consumer_timeout = 86400000 # 24 hours
3 changes: 2 additions & 1 deletion radis/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@
CELERY_TASK_DEFAULT_PRIORITY = 5

# Only non prefetched tasks can be sorted by their priority. So we prefetch
# only one task at a time.
# only one task for each availalbe child process. The number of child processes
# can be set with the -c parameter when starting the worker.
CELERY_WORKER_PREFETCH_MULTIPLIER = 1

# Only acknowledge the Celery task when it was finished by the worker.
Expand Down

0 comments on commit fd9cfe6

Please sign in to comment.