[rabbitmq-discuss] Keeping idle connections alive in EC2

Nishanth Babu Achuthan nishanth at urbanmapping.com
Fri Mar 8 21:52:17 GMT 2013


Hi Roy,

Typical job processing time is 24 hours. I set up heartbeat_interval =
432000 (5 days) . When I tried this earlier, connection dropped off
approximately after 10 mins.

I tried with heartbeat=0 and looks like it is working. I find the
connection active after 90 minutes since the message processing started.

I am now testing with jobs that would take about 1-2 days to complete
processing. Will update you once the testing is complete.

Thank you so much for your help!

Nishanth


On Fri, Mar 8, 2013 at 12:13 PM, Gavin M. Roy <gmr at meetme.com> wrote:

>
> 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
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130308/6fd1f9bf/attachment.htm>


More information about the rabbitmq-discuss mailing list