net.ipv4.tcp_max_syn_backlog = 65536
net.core.netdev_max_backlog = 131072
net.core.somaxconn = 4096
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_keepalive_intvl = 10
net.ipv4.tcp_keepalive_probes = 4
net.ipv4.tcp_keepalive_time = 60
# https://mrotaru.wordpress.com/2013/10/10/scaling-to-12-million-concurrent-connections-how-migratorydata-did-it/
net.core.wmem_default = 1024
net.core.rmem_default = 1024
net.core.rmem_max = 8192
net.core.wmem_max = 8192
net.ipv4.tcp_mem = 1024 2048 8192
net.ipv4.tcp_rmem = 1024 2048 8192
net.ipv4.tcp_wmem = 1024 2048 8192
net.ipv4.tcp_moderate_rcvbuf = 0
net.ipv4.tcp_moderate_rcvbuf = 1
[
{rabbit, [
{tcp_listeners, [{"0.0.0.0", 5672}]},
{tcp_listen_options, [
{backlog, 4096},
{nodelay, true},
{linger, {true,0}},
{exit_on_close, false},
{buffer, 1024},
{sndbuf, 1024},
{recbuf, 1024}
]}
]},
{rabbitmq_web_mqtt, [
{num_tcp_acceptors, 1024},
{tcp_config, [
{backlog, 4096},
{nodelay, true},
{linger, {true,0}},
{exit_on_close, false},
{buffer, 1024},
{sndbuf, 1024},
{recbuf, 1024}
]}
]}
].
Here is some sample client code. Connect to any rabbit node with above tweaks (from Luke). For these tests:
Ubuntu 16.04, 8 core 32G ram
Rabbitmq 3.7.4
Erlang 20.2
To run,If I set the client count to 25000, with the above tweaks and 10 millisecond delay between clients, I only get approx. 2900 queues.
go get "github.com/eclipse/paho.mqtt.golang"
MQTT_HOST='http://127.0.0.1:15675/ws' CLIENT_COUNT=25000 go run main.go
sudo rabbitmqctl list_queues | wc -l
2936
After adjusting ranch max connections:
sudo rabbitmqctl eval 'ranch:set_max_connections(web_mqtt, 10000).'
sudo rabbitmqctl list_queues | wc -l 20001
Please let me know if there is more I need to provide. I want to say thanks for all the help. Brad
--
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-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.
sudo rabbitmqctl eval 'ranch_server:count_connections(web_mqtt).'
2044
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.
2018-04-16 16:55:16.382 [info] <0.7438.20> WEB-MQTT: unexpected message {bump_credit,{<0.7458.20>,200}}
2018-04-16 16:55:16.420 [error] <0.31380.61> CRASH REPORT Process <0.31380.61> with 0 neighbours exited with reason: {timeout,{gen_server,call,[<0.31390.61>,{call,{'queue.declare',0,<<"mqtt-subscription-29ea488f-4bb0-45bb-9e60-568ff2e978e8qos0">>,false,false,false,true,false,[]},none,<0.31380.61>},60000]}} in gen_server:call/3 line 214
2018-04-16 16:55:16.420 [error] <0.31378.61> Supervisor {<0.31378.61>,rabbit_web_mqtt_connection_sup} had child cowboy_clear started with cowboy_clear:start_link(web_mqtt, #Port<0.6575087>, ranch_tcp, #{env => #{dispatch => [{'_',[],[{[<<"ws">>],[],rabbit_web_mqtt_handler,[]}]}],keepalive_sup => <0.31379.61>,...},...}) at <0.31380.61> exit with reason {timeout,{gen_server,call,[<0.31390.61>,{call,{'queue.declare',0,<<"mqtt-subscription-29ea488f-4bb0-45bb-9e60-568ff2e978e8qos0">>,false,false,false,true,false,[]},none,<0.31380.61>},60000]}} in context child_terminated
2018-04-16 16:55:16.420 [error] <0.31378.61> Supervisor {<0.31378.61>,rabbit_web_mqtt_connection_sup} had child cowboy_clear started with cowboy_clear:start_link(web_mqtt, #Port<0.6575087>, ranch_tcp, #{env => #{dispatch => [{'_',[],[{[<<"ws">>],[],rabbit_web_mqtt_handler,[]}]}],keepalive_sup => <0.31379.61>,...},...}) at <0.31380.61> exit with reason reached_max_restart_intensity in context shutdown
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.
{tcp_config, [
{backlog, 4096},
{max_connections, infinity},
{nodelay, true}
]}