[rabbitmq-discuss] Keeping idle connections alive in EC2

Gavin M. Roy gmr at meetme.com
Fri Mar 8 20:13:20 GMT 2013


On Fri, Mar 8, 2013 at 2:59 PM, Nishanth Babu Achuthan <
nishanth at urbanmapping.com> wrote:

> Hi Roy,
>
> I am not using time.sleep in my app.
>
> Worker consumes message from the queue. It then starts processing it which
> takes several hours to complete.
>

Perhaps this is a key point.


> In the meantime, the connection is dropped off due to timeout. Once the
> processing is complete, the worker tries to send ACK. While doing so, it
> fails with the error below and the worker shuts down.
>
> render_jobs_consumer - INFO -
> tableau-classic-admin0-borders-en-us-extent-101.mbtiles published for
> merging
> render_jobs_consumer - INFO -
> tableau-classic-admin0-borders-en-us-extent-101.mbtiles rendering completed
> in 334.802966833. Sending acknowledgement
>
>
I think this shows it takes over 5 minutes to process a message. If
heartbeats are less than that, it will time out unless your consumer app
that is doing rendering is making pika process data events.

Since pika is not running in a thread or isolated runtime, the things your
consumer does impact its ability to read and respond to frames from
RabbitMQ.

Quick fix is most likely to turn heartbeats off (forcing a heartbeat=0 in
your connection parameters) or set it to 4-5x your average processing time.


> pika.adapters.base_connection - ERROR - Read empty data, calling disconnect
> pika.adapters.base_connection - WARNING - Unknown state on disconnect: 5
> pika.connection - WARNING - Disconnected from RabbitMQ at
> 192.168.2.182:5672 (0):
> pika.adapters.select_connection - INFO - Unregistering poller on fd 3
>
>
Please let us know if this addresses your issue,

Gavin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130308/9ac227db/attachment.htm>


More information about the rabbitmq-discuss mailing list