Ubuntu 22.10 Optimizing OpenSSH Server Memory Use, Other RAM Optimizations Coming

Written by Michael Larabel in Ubuntu on 27 August 2022 at 05:52 AM EDT. 21 Comments
UBUNTU
As part of a broader effort to reduce system memory use on Ubuntu Linux particularly for server and container/cloud use-cases, Ubuntu 22.10's OpenSSH server has switched to using socket-based activation.

Ubuntu 22.10's OpenSSH daemon will now only start once there is an incoming connection request received, rather than running SSHD regardless of any connection request.

By not running the OpenSSH daemon until there is an incoming connection request, they save around 3MB of system memory and in the case of lightweight VMs / LXD containers, that can be around 5% of memory use for an idle, brand new Ubuntu 22.10 container.

This switch to socket-based activation for the SSH server is part of a broader push to make Ubuntu Linux leaner on the Ubuntu Server front especially for virtual machines and containers. Longtime Ubuntu engineer Steve Langasek with Canonical noted:
At Canonical we care about making Ubuntu as efficient as possible on your hardware and in the cloud, which is why this change has been landed as part of a larger effort to reduce the default memory footprint of our images. A default Ubuntu 22.04 LXD image at release time used 65MiB of RAM, which in kinetic now uses 58MiB after this OpenSSH change; and more improvements are in progress, with the intention of backporting the safer changes to our Ubuntu 22.04 images to improve memory usage for the greatest number of users.

So further tuning is in the works to make Ubuntu more lightweight for these server use-cases and some of these optimizations will find their way back into Ubuntu 22.04 as the current Long-Term Support series.


There is a renewed push by Canonical to lighten Ubuntu's memory footprint, particularly around cloud VMs and containers.


This socket-based activation handling for SSHD will happen automatically when moving to the latest Ubuntu 22.10 package. More details on this change for those interested via the Ubuntu Discourse.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week