innovatism
innovatism

Reputation: 389

RabbitMq, client close TCP connection abruptly

i'm writting a small program for crawling all the urls received from a RabbitMQ queue. I've tested with about 6000 urls and after a half of them have been processed, the client stop without an exception, all the connections to the rabbitmq server are lost. I've checked also the log and have some thing like

=WARNING REPORT==== 7-Apr-2016::10:40:50 ===
closing AMQP connection <0.32373.9> (192.168.55.1:55716 -> 192.168.55.100:5672):
connection_closed_abruptly

I'm using this connection factory setting:

ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("192.168.55.100");
        factory.setUsername(params.username);
        factory.setPassword(params.password);
        factory.setVirtualHost(params.virtualHost);
        factory.setAutomaticRecoveryEnabled(true);
        factory.setRequestedHeartbeat(2);

Do you have some ideas about this? Regards!

Upvotes: 0

Views: 1595

Answers (1)

Gabriele Santomaggio
Gabriele Santomaggio

Reputation: 22682

you have to configure RabbitMQ and you OS to handle more connections.

Read this: https://www.rabbitmq.com/networking.html

Erlang VM I/O Thread Pool Erlang runtime uses a pool of threads for performing I/O operations asynchronously. The size of the pool is configured via the +A VM command line flag, e.g. +A 128. We highly recommend overriding the flag using the RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS environment variable:

RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="+A 128"

and also this: https://www.rabbitmq.com/production-checklist.html

Open File Handles Limit Operating systems limit maximum number of concurrently open file handles, which includes network sockets. Make sure that you have limits set high enough to allow for expected number of concurrent connections and queues.

Upvotes: 1

Related Questions