python - Celery - Reuse a broker connection with apply_async() -
we have django app uses celery's apply_async() call send tasks our rabbitmq server. problem when there thousands of requests coming django app, each apply_async() call cause open thousands of new connections rabbitmq server.
in celery documentation apply_async, there connection parameter:
connection – re-use existing broker connection instead of establishing new one.
my question is, how can use in django app? cannot find examples of how use this. running django using gunicorn, ideally have each worker create 1 connection broker , re-use between requests. in way, number of connections opened on broker limited amount of workers running.
Comments
Post a Comment