Multiple (multiplexed) simultaneous ssh connections - Cygwin bug?

Goldburt, Dan Dan.Goldburt at dowjones.com
Mon Sep 11 22:22:36 EST 2006


Hi,

Ok, so I'm thinking about taking Darren's suggestion:
> It's not pretty but you could run multiple sshd's on several ports.

But before I do, I was hoping to get some help in optimizing the fix.

1. What does the cygwin limitation bound my max sessions to?
Is it:
a) 30
> You'll have the stdout and stderr descriptors in the
> select's readset,
> which for FD_SETSIZE=64 puts the limit at around 30
> connections or so
> (assuming you're not port forwarding or something too).
b) 20
> Thinking about it, that's wrong (I was thinking of poll).
> Since select
> uses bitmasks it doesn't matter how many are in each of
> the readset and
> writeset so the limit would be around 20 concurrent.
or c) 10
> I think I'm definitely overrunning the fd_set. Running the 
> test again with a just started sshd instance, I get the 
> error fcntl(31, F_GETFL, 0). So the limit seems to be 30 
> fds, or 10 connections (3 fd per connection).

2. I need to make sure if I do still accidentally overrun the fd_set, I
will not crash sshd. Right now it goes into an infinite loop spitting
out "select: Bad file descriptor" and taking up 100% CPU. Surely this is
a bug that needs to be patched?

3. Any chance I can overcome the limitation from inside sshd? How do I
implement the following:
> To make this work, you would probably need to break the
> select into FD_SETSIZE chunks somehow.



More information about the openssh-unix-dev mailing list