6 comments

  • josephg5 hours ago
    Any chance this work can be upstreamed into mainline SSH? I'd love to have better performance for SSH, but I'm probably not going to install and remember to use this just for the few times it would be relevant.
    • Bender2 hours ago
      I doubt this would ever be accepted upstream. That said if one wants speed play around with lftp [1]. It has a mirror subsystem that can replicate much of rsync functionality in a chroot sftp-only destination and can use multiple TCP&#x2F;SFTP streams in a batch upload and per-file meaning one can saturate just about any upstream. I have used this for transferring massive postgres backups and then because I am paranoid when using applications that automatically multipart transfer files I include a checksum file for the source and then verify the destination files.<p>The only downside I have found using lftp is that given there is no corresponding daemon <i>for rsync</i> on the destination then directory enumeration can be slow if there are a lot of nested sub-directories. Oh and the syntax is a little odd <i>for me anyway</i>. I always have to look at my existing scripts when setting up new automation.<p><i>Demo to play with, download only. Try different values. This will be faster on your servers, especially anything within the data-center.</i><p><pre><code> ssh mirror@mirror.newsdump.org # do this once to accept key as ssh-keyscan will choke on my big banner mkdir -p &#x2F;dev&#x2F;shm&#x2F;test &amp;&amp; cd &#x2F;dev&#x2F;shm&#x2F;test lftp -u mirror, -e &quot;mirror --parallel=4 --use-pget=8 --no-perms --verbose &#x2F;pub&#x2F;big_file_test&#x2F; &#x2F;dev&#x2F;shm&#x2F;test;bye&quot; sftp:&#x2F;&#x2F;mirror.newsdump.org </code></pre> For automation add <i>--loop</i> to repeat job until nothing has changed.<p>[1] - <a href="https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;lftp" rel="nofollow">https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;lftp</a>
      • chasil28 minutes ago
        The normal answer that I have heard to the performance problems in the conversion from scp to sftp is to use rsync.<p>The design of sftp is such that it cannot exploit &quot;TCP sliding windows&quot; to maximize bandwidth on high-latency connections. Thus, the migration from scp to sftp has involved a performance loss, which is well-known.<p><a href="https:&#x2F;&#x2F;daniel.haxx.se&#x2F;blog&#x2F;2010&#x2F;12&#x2F;08&#x2F;making-sftp-transfers-fast&#x2F;" rel="nofollow">https:&#x2F;&#x2F;daniel.haxx.se&#x2F;blog&#x2F;2010&#x2F;12&#x2F;08&#x2F;making-sftp-transfers...</a><p>The rsync question is not a workable answer, as OpenBSD has reimplemented the rsync protocol in a new codebase:<p><a href="https:&#x2F;&#x2F;www.openrsync.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.openrsync.org&#x2F;</a><p>An attempt to combine the BSD-licensed rsync with OpenSSH would likely see it stripped out of GPL-focused implementations, where the original GPL release has long standing.<p>It would be more straightforward to design a new SFTP implementation that implements sliding windows.<p>I understand (but have not measured) that forcibly reverting to the original scp protocol will also raise performance in high-latency conditions. This does introduce an attack surface, should not be the default transfer tool, and demands thoughtful care.<p><a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;835962&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;835962&#x2F;</a>
      • zenoprax46 minutes ago
        Wow, I hadn&#x27;t heard of this before. You&#x27;re saying it can &quot;chunk&quot; large files when operating against a remote sftp-subsystem (OpenSSH)?<p>I often find myself needing to move a single large file rather than many smaller ones but TCP overhead and latency will always keep speeds down.
        • aidenn041 minutes ago
          I use lftp a lot because of it&#x27;s better UI compared to sftp. However, for large files, even with scp I can pin GigE with an old Xeon-D system acting as a server.
    • harvie4 hours ago
      Also upstream is extremely well audited. That&#x27;s a huge benefit i don&#x27;t want to loose by using fork.
      • Bad_CRC4 hours ago
        this, I&#x27;m not going to start using a random ssh fork with modified ciphers.
        • Zambyte2 hours ago
          It may still be sensible if you only expose it to private networks.
          • bomewish2 hours ago
            So could this safely be used on Tailscale then ? I’m very curious though also a bit paranoid.
            • messe2 hours ago
              &gt; So could this safely be used on Tailscale then ? I’m very curious though also a bit paranoid.<p>You may as well just use tailscale ssh in that case. It already disables ssh encryption because your connection is encrypted with WireGuard anyway.
            • gear54rus2 hours ago
              It could safely be used on public internet, all this fearmongering has no basis under it.<p>Better question is &#x27;does it have any actual improvements in day-to-day operations&#x27;? Because it seems like it mostly changes up some ciphering which is already very fast.
              • yjftsjthsd-h1 hour ago
                &gt; It could safely be used on public internet, all this fearmongering has no basis under it.<p>On what basis are making that claim? Because AFAICT, concern about it being less secure is entirely reasonable and is one of the big caveats to it.
              • Zambyte2 hours ago
                I&#x27;m not fear mongering. I&#x27;m just saying<p>- IF you don&#x27;t trust it<p>- AND you want to use it<p>=&gt; run it on a private network<p>You don&#x27;t have to trust it for security to use it. Putting services on secure networks when the public doesn&#x27;t need access is standard practice.
      • emilfihlman1 hour ago
        lose*
    • Almondsetat4 hours ago
      OpenSSH is from the people at OpenBSD, which means performance improvements have to be carefully vetted against bugs, and, judging by the fact that they&#x27;re still on fastfs and the lack of TRIM in 2025, that will not happen.
      • wahern2 hours ago
        There&#x27;s nothing inherently slow about UFS2; the theoretical performance profile should be nearly identical to Ext4. For basic filesystem operations UFS2 and Ext4 will often be faster than more modern filesystems.<p>OpenBSD&#x27;s filesystem operations are slow not because of UFS2, but because they simply haven&#x27;t been optimized up-and-down the stack the way Ext4 has been Linux or UFS2 on FreeBSD. And of course, OpenBSD&#x27;s implementation doesn&#x27;t have a journal (both UFS and Ext had journaling bolted late in life) so filesystem checks (triggered on an unclean shutdown or after N boots) can take a long time, which often cause people to think their system has frozen or didn&#x27;t come up. That user interface problem notwithstanding, UFS2 is extremely robust. OpenBSD is very conservative about optimizations, especially when they increase code complexity, and particularly for subsystems where the project doesn&#x27;t have time available to give it the necessary attention.
        • chasil2 minutes ago
          OpenBSD UFS did have &quot;soft updates&quot; which were some kind of alternative to journaling.<p>I believe that these were recently removed. Perhaps they don&#x27;t play well with SMP.
    • frantathefranta2 hours ago
      I admittedly don&#x27;t really know how SSH is built but it looks to me like the patch that &quot;makes&quot; it HPN-SSH is already present upstream[1], it&#x27;s just not applied by default? Nixpkgs seems to allow you to build the pkg with the patch [2].<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;freebsd&#x2F;freebsd-ports&#x2F;blob&#x2F;main&#x2F;security&#x2F;openssh-portable&#x2F;files&#x2F;extra-patch-hpn" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;freebsd&#x2F;freebsd-ports&#x2F;blob&#x2F;main&#x2F;security&#x2F;...</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;blob&#x2F;d85ef06512a3afbd6f90825dd8f5b6cef017bdd6&#x2F;pkgs&#x2F;tools&#x2F;networking&#x2F;openssh&#x2F;default.nix#L40" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;blob&#x2F;d85ef06512a3afbd6f9082...</a>
      • yjftsjthsd-h1 hour ago
        Upstream is either OpenBSD itself or <a href="https:&#x2F;&#x2F;github.com&#x2F;openssh&#x2F;openssh-portable" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;openssh&#x2F;openssh-portable</a> , not the FreeBSD port. I&#x27;m... not sure why nix is pulling the patch from FreeBSD, that&#x27;s odd.
    • suprjami3 hours ago
      Unlikely. These patches have been carried out-of-tree for over a decade precisely because upstream OpenSSH won&#x27;t accept them.
    • hsbauauvhabzb3 hours ago
      Depending on your hardware architecture and security needs, fiddling with ciphers in mainline might improve speed.
  • nhatcher1 hour ago
    If folks find this interesting, maybe also mosh[1] is for you. Different trade offs.<p>[1]: <a href="https:&#x2F;&#x2F;mosh.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mosh.org&#x2F;</a>
  • freedomben1 hour ago
    This is cool very cool and I think I&#x27;ll give it a try, though I&#x27;m wary about using a forked SSH so would love to see things land upstream.<p>I&#x27;ve been using mosh now for over a decade and it is amazing. Add on rsync for file transfers and I&#x27;ve felt pretty set. If you haven&#x27;t checked out mosh, you should definitely do so!
    • chrisweekly1 hour ago
      wary (cautious or skeptical), not weary (tired)
      • actionfromafar1 hour ago
        At this point, maybe both. :) Can we have a portmanteau?
        • freedomben1 hour ago
          Indeed! I meant wary, but both kind of fit :-D
      • freedomben1 hour ago
        Heh, thank you! Edited
  • baden19271 hour ago
    The contracting activity in terms of rsync and async, where SFTP is secure tunneling, either with SSH or OpenSSH, which -p flag specifies as the port: 22, but &#x2F;ssh&#x2F;.configuring 10901 works for TCP.
  • tristor43 minutes ago
    I don&#x27;t think it comes as a surprise that you can improve performance by re-implementing ciphers, but what is the security trade-off? Many times, well audited implementations of ciphers are intentionally less performant in order to operate in constant time and avoid side channel attacks. Is it even possible to do constant time operations while being multithreaded?<p>The only change I see here that is probably harmless and a speed boost is using AES-NI for AES-CTR. This should probably be an upstream patch. The rest is more iffy.
  • ollybee1 hour ago
    It&#x27;s not clear if you need it on both ends to get an advantage?