Maximum socket Connection with epoll - epoll

I'm using CentOS (Linux) and was wondering
the maximum connection that one server can have through epoll (Edge Trigger, OneSHot) .
I've succeeded in having 100,016 connections doing ping-pongs (nonstop) atm. How many socket connections can one server handle?
I don't think it is unlimited. If anyone who've tried it. Could you please share ?

500,000 TCP connections from a single server is the gold standard these days. The record is over a million. It does require kernel tuning. See, for example, Linux Kernel Tuning for C500k.

Related

Is there any limit for maximum number of TCP connections that can be made from a container to RabbitMQ

I am new in rabbitmq, So i am facing a in rabbitmq like "The connection cannot support anymore channels.Consider creating a new connection". So my doubt is can we create multiple tcp connections to rabbitmq from a single docker conatiner? Is there any limit for maximum number of TCP connections that can be made from a container? Please help
I tried to find out from doc but I didn't get a proper answer.
can we create multiple tcp connections to rabbitmq from a single docker container?
yes you can.
Is there any limit for maximum number of TCP connections that can be made from a container?
There is no hard-coded limit. It depends on number of CPUs/Memory etc... RabbitMQ is not different from other kinds of services.
We have a production checklist with some best
The connection cannot support anymore channels.Consider creating a new connection".
Adding too many channels inside one single connection is not recommended. There is no limit but hundreds of channels is not a good value.

WebRtc Maximum Connections, only using data channels

My question is if I plan to use WebRTC with a p2p architecture but only using its custom data channel to send constant small text messages. ¿What is the maximum number of peer connections that a peer can support? (I know this its heavily going to depend on the device, network... of each peer, but could somebody give me a ballpark estimate).
Edit: By constant text messages i mean around 30 / sec
One of limitations might be maximum amount of available ports in the device's OS. For example, Ubuntu has about 65k available ports. So, supposing that you have enough memory, CPU and network bandwith, and 1 port for 1 data channel then you have ~65k connections.

EMQX Benchmarking Issue

Is it possible to test the WebSocket connection test for 100k users on single node? If yes, how?
I am wondering how the 1 million connection test per node was carried out as claimed on EMQX official site.
If the port limit of OS itself is 65536
The server only needs one port.
The clients port limit of the operating system can be bypassed (using multiple network cards in ). You can use JMeter to test the connection. In order to simulate the client, multiple servers may be required. Here is an EMQ official video, which gives some operating procedures.
https://www.bilibili.com/video/BV1yp4y1S7zb

Which MQTT server for > 1M connections [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
With a budget of perhaps a few million to setup a MQTT server farm how would you do so?
It must have the following properties:
Support for 4-5M connections across all data centers.
300k msg/s of around 1kb each
Geographic redundancy
Can't lose messages QOS1
Each client will publish to a single topic but subscribe to their own unique topic. This implies 4-5 million topics.
MQTT Server brokers can be found here:
https://github.com/mqtt/mqtt.github.io/wiki/server-support#capabilities
However capabilities are usually not published.
Although the Erlang powered VerneMQ MQTT broker is still quite new, there is nothing (besides RAM/CPU/IPs/Bandwidth) that should prevent you from opening that many connections.
http://verne.mq
make sure to set something similar to:
listener.max_connections = infinity
listener.nr_of_acceptors = 1000
erlang.max_ports = 10000000
erlang.process_limit = 10000000
in your vernemq.conf
disclaimer: I'am one of the devs of VerneMQ and happy to help you reach your 1M connections/server.
HiveMQ is a self hosted, java based Enterprise MQTT broker, specifically designed to support millions of concurrent connections.
The HiveMQ team has done a benchmark, connecting more than 10.000.000 concurrent MQTT clients to a HiveMQ broker cluster. To reach this number, accompanied with a decent performance, some configuration needed to be done on the operating system of the used machines.
Open files in /etc/security/limits.conf:
hivemq hard nofile 1000000
hivemq soft nofile 1000000
root hard nofile 1000000
root soft nofile 1000000
TCP tweaking in /etc/sysctl.conf
# This causes the kernel to actively send RST packets when a service is overloaded.
net.ipv4.tcp_fin_timeout = 30
# The maximum file handles that can be allocated.
fs.file-max = 5097152
# Enable fast recycling of waiting sockets.
net.ipv4.tcp_tw_recycle = 1
# Allow to reuse waiting sockets for new connections when it is safe from protocol viewpoint.
net.ipv4.tcp_tw_reuse = 1
# The default size of receive buffers used by sockets.
net.core.rmem_default = 524288
# The default size of send buffers used by sockets.
net.core.wmem_default = 524288
# The maximum size of received buffers used by sockets.
net.core.rmem_max = 67108864
# The maximum size of sent buffers used by sockets.
net.core.wmem_max = 67108864
# The size of the receive buffer for each TCP connection. (min, default, max)
net.ipv4.tcp_rmem = 4096 87380 16777216
# The size of the sent buffer for each TCP connection. (min, default, max)
net.ipv4.tcp_wmem = 4096 65536 16777216
Details on the VMs used, the specific configurations needed on the OS side and detailed performance results can all be found in the 10 Million Benchmark Paper
Disclaimer: I am part of the HiveMQ Team.
IBM Messagesight appliance. Specifically designed for large scale IOT deployments such as connected cars:
http://www-03.ibm.com/software/products/en/messagesight
Clustering IBM IoT MessageSight servers is possible with v2.0 which allows you to scale a single MessageHub to multiple servers, thus enabling >1M connections even.
Akiro MQTT Broker deals with this scale and is a very reliable and low latency broker which is available which is powered by Async IO.
Akiro can handle 10 Million connections with 12 brokers with commodity hardware, which is one of the best benchmarks for a MQTT broker today. Its also being used by major telecoms. Give it a shot. Thanks
P.S I am part of the Akiro team :)
You do not need few million dollars to achieve this. Actually you do not need even tens of thousands - flespi broker in it's commercial version achieves all numbers that you (were) need, except Geographic redundancy at that moment of time. And not only achieves - it is being used with multiple similar loads each day, 24/7 with 99.98% uptime.
It is cloud based broker with private namespace, so even it's free version available for everybody capable of serving the traffic up to 200 MB/minute.

Erlang's maximum number of simultaneous open ports?

Does the erlang TCP/IP library have some limitations? I've done some searching but can't find any definitive answers.
I have set the ERL_MAX_PORTS environment variable to 12000 and configured Yaws to use unlimited connections.
I've written a simple client application that connects to an appmod I've written for Yaws and am testing the number of simultaneous connections by launch X number of clients all at the same time.
I find that when I get to about 100 clients, the Yaws server stops accepting more TCP connections and the client errors out with
Error in process with exit value: {{badmatch,{error,socket_closed_remotely}}
I know there must be a limit to the number of open simultaneous connections, but 100 seems really low. I've looked through all the yaws documentation and have removed any limit on connections.
This is on a 2.16Ghz Intel Core 2 Duo iMac running Snow Leopard.
A quick test on a Vista Machine shows that I get the same problems at about 300 connections.
Is my test unreasonable? I.e. is it silly to open 100+ connections simultaneously to test Yaws' concurrency?
Thanks.
It seems you hit a system limitation, try to increase the max number of open files using
$ ulimit -n 500
Python on Snow Leopard, how to open >255 sockets?
Erlang itself has a limit of 1024:
From http://www.erlang.org/doc/man/erlang.html
The maximum number of ports that can be open at the same time is 1024 by default, but can be configured by the environment variable ERL_MAX_PORTS.
EDIT:
The system call listen()
has a parameter backlog which determines how many requests can be queued, please check whether a delay between requests to establish connections helps. This could be your problem.
All Erlang system limits are reported in the Erlang Efficiency Guide:
http://erlang.org/doc/efficiency_guide/advanced.html#id2265856
Reading from the open ports section:
The maximum number of simultaneously
open Erlang ports is by default 1024.
This limit can be raised up to at most
268435456 at startup (see environment
variable ERL_MAX_PORTS in erlang(3))
The maximum limit of 268435456 open
ports will at least on a 32-bit
architecture be impossible to reach
due to memory shortage.
After trying out everybody's suggestion and scouring the Erlang docs, I've come to the conclusion that my problem is with Yaws not being able to keep up with the load.
On the same machine, an Apache Http Components web server (non-blocking I/O) does not have the same problems handling connections at the same thresholds.
Thanks for all your help. I'm going to move on to other erlang based web servers, like Mochiweb.

Resources