RabbitMq,客户端突然关闭TCP连接
RabbitMq, client close TCP connection abruptly
我正在编写一个小程序来抓取从 RabbitMQ 队列接收到的所有 url。我已经测试了大约 6000 个 url,在处理了一半之后,客户端无一例外地停止了,所有与 rabbitmq 服务器的连接都丢失了。我也检查了日志并有类似
的东西
=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
我正在使用此连接出厂设置:
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);
你对此有什么想法吗?问候!
您必须配置 RabbitMQ 并且 OS 处理更多连接。
读这个: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"
还有这个: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.
我正在编写一个小程序来抓取从 RabbitMQ 队列接收到的所有 url。我已经测试了大约 6000 个 url,在处理了一半之后,客户端无一例外地停止了,所有与 rabbitmq 服务器的连接都丢失了。我也检查了日志并有类似
的东西=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
我正在使用此连接出厂设置:
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);
你对此有什么想法吗?问候!
您必须配置 RabbitMQ 并且 OS 处理更多连接。
读这个: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"
还有这个: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.