[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OpenSSHD Server

On Wed, Sep 30, 2009 at 11:29:29PM -0400, Roman Gelfand wrote:

> Everytime I am connecting to my server via ssh, memory utilizaiton
> appears to be increasing.  Is there memory leak issues with sshd or,
> perhaps, there is a maintenance that needs to be performed? or just

Concurrent connections will fork processes, thereby increasing system
memory usage. If your connections aren't concurrent, make sure you're
reaping stale sessions. Make sure you have something like:

    TCPKeepAlive yes
    ClientAliveInterval 15
    ClientAliveCountMax 3

in /etc/ssh/sshd_config, or sshd may not notice that sessions have died,
and keep them around indefinitely.

Also, "memory usage" in general isn't always what you think it is. A lot
of times, the Linux kernel is simply adjusting free memory to cache
files or buffer data, so looking at those statistics isn't useful.

Check the RSS size of the process with:

    ps -FC sshd

Lots of things may affect the SZ and RSS of the sshd children. On some
of my boxes, I've seen SZ as high as 16MB per process, while on other
boxes it's as low as 1.3MB, but I rarely see RSS higher than about 3MB.

Unless you are actually running out of memory, or can provide some
process statistics to show what the problem is, I wouldn't worry about

"Oh, look: rocks!"
	-- Doctor Who, "Destiny of the Daleks"

Reply to: