I was trying to set up 2000 concurrent ssh connections, but got the error message in server log (i.e.
sshd: error: reexec socketpair: Too many open files
I've set both the soft and hard limit for
ulimit -n gives me 1 048 000.
Max open files in
/proc/<ssh_pid>/limitsis 1 048 000, which is consistent with the value of
nofile mentioned above (i.e. the value for
When my script for setting up ssh connections was running, I tried
lsof | wc -l several times and the values it gave me were around 260 000, which is much less than the open file limit.
So my question is why it complains about "Too many open files" when the actual number of open files is far below the limit?
This question seems similar but I still don't know what to do after reading it: FreeBSD: "Too many open files" but should be able to open another 160,000 files
Any idea is appreciated!