We recently upgraded a high volume CentOS 7 SFTP server running openssh/internal-sftp to Rocky Linux 8.
However, since the upgrade we are experiencing login timeout issues after the server has been running for 1-2 hours. This seems to be related to the number of open SFTP sessions and/or systemd --user processes.
After 1-2 hours new SFTP logins become extremely slow and we start seeing these messages in the log
Apr 14 12:16:58 sftp sshd[330585]: pam_systemd(sshd:session): Failed to create session: Connection timed out Sometimes it clears up if enough SFTP sessions are closed fast enough, but more often we have to reboot the server to restore normal service.
Would it be advisable to disable systemd-logind as this doesn't seem needed for SSH?
UPDATE
Not sure if this is relevant, but systemctl list-units --state=abandoned returns 100's of abandoned sessions.
UPDATE 2
After disabling pam_systemd.so system is running normally again. This effectively disables systemd-logind for SSH sessions.
80% reduced system load indicates massive performance penalty using systemd-logind.
Is this normal?!