Skip to content

Instantly share code, notes, and snippets.

@anandtripathi5
Created April 21, 2021 09:00
Show Gist options
  • Save anandtripathi5/69d252d9db423e3ec72007e37e14fef4 to your computer and use it in GitHub Desktop.
Save anandtripathi5/69d252d9db423e3ec72007e37e14fef4 to your computer and use it in GitHub Desktop.
Celery production ready configuration
broker_url = "{}://{}:{}@{}:{}/{}".format(
broker_protocol,
broker_username,
broker_password,
broker_host,
broker_port,
broker_vhost)
worker_send_task_event = False
task_ignore_result = True
# task will be killed after 60 seconds
task_time_limit = 60
# task will raise exception SoftTimeLimitExceeded after 50 seconds
task_soft_time_limit = 50
# task messages will be acknowledged after the task has been executed, not just before (the default behavior).
task_acks_late = True
# One worker taks 10 tasks from queue at a time and will increase the performance
worker_prefetch_multiplier = 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment