首页 > 代码库 > redis celery too many connection
redis celery too many connection
用django 框架,异步任务用celery,队列用redis
出现了这个问题,too many connection
Couldn‘t ack ‘5f41afc62d-a112-bef34d5de1cc‘, reason:ConnectionError(‘Too many connections‘,)
BROKER_POOL_LIMIT
New in version 2.3.
The maximum number of connections that can be open in the connection pool.
The pool is enabled by default since version 2.5, with a default limit of ten connections. This number can be tweaked depending on the number of threads/greenthreads (eventlet/gevent) using a connection. For example running eventlet with 1000 greenlets that use a connection to the broker, contention can arise and you should consider increasing the limit.
If set to None or 0 the connection pool will be disabled and connections will be established and closed for every use.
CELERY_REDIS_MAX_CONNECTIONS
BROKER_TRANSPORT_OPTIONS
New in version 2.2.
A dict of additional options passed to the underlying transport.
See your transport user manual for supported options (if any).
Example setting the visibility timeout (supported by Redis and SQS transports):
BROKER_TRANSPORT_OPTIONS = {‘visibility_timeout‘: 18000} # 5 hours
redis celery too many connection