3 ms·
You should be limited only by the number of fds allowed on your system / for your user(s). I believe each connection would be counted as an fd for the server si
by toast0 6y ago
You should be limited only by the number of fds allowed on your system / for your user(s). I believe each connection would be counted as an fd for the server side and the client side; and the listen socket is also a fd on the server side. So max_fds / 2 - 1; assuming you have no other fds open (which is pretty hard to do, but gives you a ceiling).
On FreeBSD, you can tune kern.maxfiles up to the number of physical memory pages / 4 [1], despite the nearby comments suggesting a lower limit. You may need to tune some other values as well, and have a pretty tight software stack (or a lot of swap) to average less than 16k of ram per fd.
[1] https://github.com/freebsd/freebsd-src/blob/master/sys/kern/subr_param.c#L289 https://github.com/freebsd/freebsd-src/blob/master/sys/kern/...