Redis celery Too many connection

Source: Internet
Author: User

Using the Django framework, asynchronous tasks with celery, redis for queues

There was this problem, too many connection

Couldn ' t ack ' 5f41afc62d-a112-bef34d5de1cc ', Reason:connectionerror (' Too many connections ',)

Traceback (most recent):  File "/srv/www/wom/env/lib/python2.6/site-packages/kombu/message.py", line 93 , in ack_log_error    self.ack ()   File "/srv/www/wom/env/lib/python2.6/site-packages/kombu/ message.py ", line-in-ack    self.channel.basic_ack (self.delivery_tag)   File"/srv/www/wom/env /lib/python2.6/site-packages/kombu/transport/virtual/__init__.py ", line 566, in basic_ack    Self.qos.ack (Delivery_tag)   File "/srv/www/wom/env/lib/python2.6/site-packages/kombu/transport/redis.py", Line, in ack    self._remove_from_indices (Delivery_tag). Execute ()   File "/srv/www/wom/env/ lib/python2.6/site-packages/redis/client.py ", line 1914, in execute    self.shard_hint)   File"/ srv/www/wom/env/lib/python2.6/site-packages/redis/connection.py ", line 395, in get_connection    Connection = Self.make_connection ()   File "/srv/www/wom/env/lib/python2.6/site-packages/redis/connection.py ", line 402, in make_connection    raise Connectionerror (" Too Many Connections ") Connectionerror:too many connections   after reading the document, set a variable broker_pool_limit

New in version 2.3.

The maximum number of connections that can is 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 is tweaked depending on the number of threads/greenthreads (eventlet/gevent) using a connection. For example running Eventlet with + 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 would be disabled and connections would be a established and closed for every Use.

The Default (since 2.5) is to use a pool of ten connections. Celery_redis_max_connectionsmaximum number of connections available in the REDIS connection pool used for sending and RETR  Ieving results. 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

To set up Max_connections to resolve the following issues

Redis celery Too many connection

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.