The limit on the number of open sockets is configured in the / proc file system
cat /proc/sys/fs/file-max
Max for incoming connections in the OS defined by integer limits.
Linux itself allows billions of open sockets.
To use sockets, you need to listen to the application, for example. a web server, and it will use a certain amount of RAM for each socket.
RAM and CPU will introduce real limits. (modern 2017, I think millions are not billions)
1 million is possible, not easy. Expect to use X gigabytes of RAM to control 1 million sockets.
Outgoing TCP connections are limited to ~ 65000 port numbers on IP. You can have multiple IP addresses, but not unlimited IP addresses. This is a limitation in TCP, not Linux.
teknopaul Apr 09 '17 at 11:03 on 2017-04-09 11:03
source share