Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 2000 21:19:06 -0500 (EST)
From:      Jim Early <earlyjp@cs.purdue.edu>
To:        freebsd-questions@FreeBSD.ORG
Subject:   ssh exhausting swap space
Message-ID:  <Pine.GSO.4.10.10005102044090.6664-100000@lisa.cs.purdue.edu>

next in thread | raw e-mail | index | archive | help

Greetings,

I have a newly installed FreeBSD V4.0-RELEASE box that I'm using as a
simple packet filter with network address translation. The machine is a
486SX with 16Mb of ram, 1Gb of disk space, and two 3Com ethernet
interfaces. I have set up a swap partition of 37Mb. Granted, it's a
dinosaur, but it's doing the job just fine.

However, I have one problem. Whenever I ssh into this machine, or try to
ssh from this machine out to another machine, ssh just keeps consuming
memory until all the swap space is exhausted, at which time the ssh
process is killed. The gateway stays up, and everything else works fine - I
only have a problem when I try to use ssh (or access through sshd).

I've made a log of one such outbound session - I'm trying to ssh from my
gateway to another machine on my subnet. Here is the debug output:

bash# ssh -v 192.168.0.2
SSH Version OpenSSH-1.2.2, protocol version 1.5.
Compiled with SSL.
debug: Reading configuration data /etc/ssh/ssh_config
debug: ssh_connect: getuid 0 geteuid 0 anon 0
debug: Connecting to 192.168.0.2 [192.168.0.2] port 22.
debug: Allocated local port 1021.
debug: Connection established.
debug: Remote protocol version 1.5, remote software version 1.2.27
debug: Waiting for server public key.
debug: Received server public key (768 bits) and host key (1024 bits).
debug: Host '192.168.0.2' is known and matches the host key.

/* We've taken about 3 seconds to get to this point, but now the process
just sits until I start getting "no swap space messages" on the gateway
console */

Killed

As I said, I know this machine is a lightweight, but I think it's
suitable for the job (previously, it had been running in the same capacity
under FreeBSD 2.2.5 for about a year).

I also don't believe that increasing the swap space is the answer. During
normal operation, if I check "top", I rarely see the free memory drop
below 7 Megs. I almost never see swap space being used, either. Right now,
the machine is running only natd, sshd, cron, sh, getty, ident2, portmap,
and adjkerntz. The remaining 44+ Mb of free memory should certainly be
enough to run an ssh session. Besides, if I did add more swap, I think it
would just get used up, too.

I've searched through the handbook, mail archives, and newsgroup archives,
and man pages but I can't find any mention of this particular problem.
There are tales of swap space being exhausted while using a large program
like Netscape, but no mention of ssh.

If anyone has some suggestions for how to resolve this problem, it would
most appreciated. Also, please reply directly to me at

	earlyjp@cs.purdue.edu

as I am not on the mailing list right now. Thanks for your assistance.

Jim Early



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10005102044090.6664-100000>