I am using rabbitmq-server-3.6.6 with Erlang R16B03-1 in CentOS 7. After installing the rabbitmq, and I am trying to use pika to build an rpc server. However, the pika.BlockingConnection() part to connec to 127.0.0.1 is so slow, which more than 8 seconds, which usually should be around 1~5ms.
Here are a list of my rabbitmq-env.conf settings, and pika connection codes:
/etc/rabbitmq/rabbitmq-env.conf:
NODENAME=rabbit@localhost
ulimit -S -n 4096
def loop_rpc_1():
import pika, time, uuid
host = '127.0.0.1'
port = 5672
user = 'rpc_user'
passwd = '123456'
vhost = '/dev'
credentials = pika.PlainCredentials(user, passwd)
list = range(1, 100)
for i in list:
start_time = time.time()
conn = pika.BlockingConnection(pika.ConnectionParameters(host, port, vhost, credentials, ))
conn.close()
print(i, time.time() - start_time)
The output:
loop_rpc_1()
1 7.42911958694458
2 5.011636972427368
3 0.008404970169067383
4 0.00924539566040039
5 8.006478071212769
6 2.010906934738159
7 0.008637666702270508
8 0.008483409881591797
9 5.0115368366241455
10 0.00960850715637207
11 0.008922576904296875
12 5.015120506286621
13 8.005479335784912
14 2.011262893676758
15 8.005752325057983
16 2.0079636573791504
17 8.006184816360474
18 2.0097343921661377
19 0.008991718292236328
20 8.00625205039978
The /var/log/rabbitmq/rabb...@localhost.log is like:
=INFO REPORT==== 17-Aug-2017::20:17:12 ===
accepting AMQP connection <0.5344.4> (127.0.0.1:44705 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:14 ===
closing AMQP connection <0.5344.4> (127.0.0.1:44705 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:14 ===
accepting AMQP connection <0.5371.4> (127.0.0.1:44706 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:19 ===
closing AMQP connection <0.5371.4> (127.0.0.1:44706 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:19 ===
accepting AMQP connection <0.5427.4> (127.0.0.1:44707 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:19 ===
closing AMQP connection <0.5427.4> (127.0.0.1:44707 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:19 ===
accepting AMQP connection <0.5434.4> (127.0.0.1:44708 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:19 ===
closing AMQP connection <0.5434.4> (127.0.0.1:44708 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:19 ===
accepting AMQP connection <0.5441.4> (127.0.0.1:44709 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:27 ===
closing AMQP connection <0.5441.4> (127.0.0.1:44709 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:27 ===
accepting AMQP connection <0.5515.4> (127.0.0.1:44710 -> 127.0.0.1:5672)
=INFO REPORT==== 17-Aug-2017::20:17:29 ===
closing AMQP connection <0.5515.4> (127.0.0.1:44710 -> 127.0.0.1:5672)
What is a standard procedure for debugging this sort of issues ?
Thanks a lot!
--You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/jbNJG9OevtY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Hi Mike,