Reputation: 607
For TCP/IP connections there is a maximum of 64k connections between two hosts if there's a single destination port (source: What is the theoretical maximum number of open TCP connections that a modern Linux box can have). Is there a connection limit for Unix domain sockets or is it just limited by the number of file descriptors?
Upvotes: 5
Views: 6127
Reputation: 343
I found two limitations on unix domain sockets:
1 - limitation based on the number of concurrent file descriptor a process can open: The number of concurrent clients is limited by the number of files a process can open take off some used file descriptors = 1014 concurrent connections by default, however this can be changed using the ulimit command. read more here https://titanwolf.org/Network/Articles/Article?AID=2fbb967c-c507-4798-990d-edc3a9b132a8
2 - The autobind feature limit of address size, essentially, if you are using the autobind feature or the security flag, the address limitation is of 2^20 autobind addresses. From Linux 2.1.15, when the autobind feature was added, 8 bytes were used, and the limit was thus 2^32 autobind addresses. The change to 5 bytes came in Linux 2.3.15. read more here https://man7.org/linux/man-pages/man7/unix.7.html
Upvotes: 4
Reputation: 1148
If you are relying on autobind to supply addresses, there is a limit imposed by address space, 2^20 on modern kernels, which is addressed in the unix(7) man page.
I would think as a practical matter the constraint would be open files, as you state.
Upvotes: 1