Hi @Amrinder,
not sure I quite understand your problem. It should be no problem to establish 100k (or even a million) connections to one port. I will try to explain the problem you are currently have in detail (the solution for that I already wrote in the last response).
As I wrote before each TCP connection is made up of this tuple:
(local ip, local port, peer ip, peer port)
Lets say peerIp is 222.222.222.222 and peerPort is 1883 for HiveMQ (or any server). This mean peerIp and peerPort are static as you always have connect via this address:
(local ip, local port, 222.222.222.222, 1883)
Now we have only “local ip” and “local port” that can be varied to make connections to the server. Now lets further say JMeter (or any tool for making connection) uses the ip “111.111.111.111” you get this template:
(111.111.111.111, local port, 222.222.222.222, 1883)
The last variable part is local port and here we are limited by the fact that you can only have max 65536* (2^16) ports that you could put into “local port”, therefore as I wrote before with only one local ip you can at max establish 65536 connections:
(111.111.111.111, 0, 222.222.222.222, 1883) (connection tuple for client1)
(111.111.111.111, 1, 222.222.222.222, 1883) (connection tuple for client2)
......
(111.111.111.111, 65534, 222.222.222.222, 1883) (connection tuple for client65535)
(111.111.111.111, 65535, 222.222.222.222, 1883) (connection tuple for client65536)
*theoretically, not sure if all port can be used
As peerIp and peerPort are fix and localPort can only have max 65536 values you need to introduce variation into local ip (and that are my two points in the last response) two achieve 100k connections.
I / We are using an internal tool that I’m regrettably not allowed to hand out. But I can tell you this much, we scale the instances where the tool is running on to achieve millions of connections similar to the distributed approach of JMeter.
Greetings,
Michael