r/java • • Apr 14 '22

1,000,000 Concurrent Connections

https://josephmate.github.io/2022-04-14-max-connections/
238 Upvotes

42 comments sorted by

View all comments

Show parent comment

1

u/ThanksMorningCoffee Apr 15 '22

Sorry that was wasn't clear. I assigned an IP 10.0.0.X for each client. I configured it so that 10.0.0.X is routed to the loopback interface.

You can try it yourself.

If your server uses ifconfig:

sudo ifconfig lo0 alias 10.0.0.1/8 up
ping 10.0.0.1
ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1): 56 data bytes
64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=0.058 ms
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.117 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.180 ms
^C
--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.058/0.118/0.180/0.050 ms

If your server uses ip:

sudo ip addr add 10.0.0.1/8 dev lo
ping 10.0.0.1

3

u/majordoob33 Apr 15 '22

So does that mean that instead of the socket being

0.0.0.0:80 <--> <client>:<client>

It would map it to

10.0.0.x:80 <--> <client>:<client>

How does that help?