[Bug 3049] New: ssh startup time is linear to _SC_OPEN_MAX

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Fri Aug 2 05:21:55 AEST 2019


https://bugzilla.mindrot.org/show_bug.cgi?id=3049

            Bug ID: 3049
           Summary: ssh startup time is linear to _SC_OPEN_MAX
           Product: Portable OpenSSH
           Version: -current
          Hardware: All
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: likan_999.student at sina.com

Created attachment 3305
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3305&action=edit
Patch against https://github.com/openssh/openssh-portable

In our company, on our MacBook we had to raise the _SC_OPEN_MAX to a
high value (currently 10M), ever since the ssh becomes very slow. By
digging into this, we found it spends 5 seconds just to close all file
descriptors. On Linux, it uses /proc/fd so it is relatively fast. On
OSX, there is no proc fs, therefore it tries all file descriptors from
3 to _SC_OPEN_MAX.

I have a patch, attached below, for portable-ssh, that adds the
particular implementation for OSX, to utilize proc_fdinfo to enumerate
all file descriiptors of the process. Please review it to see if it is
appropriate to be merged upstream. Thanks.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list