Usually my system runs a large variety of processes, but lately after about
12-24 hours of usage, it starts thrashing real hard and before you know it
the system is too slow to log in without having a timeout happen on the password
prompt. I run the 2.4.19 kernel and the latest stable versions of software.
The system is a 233MHz pentium based processor with 200 megs of memory in my system
and usually have about 475 megabytes of swap (which I turned off below so I could
demonstrate the issues I was having, but yes, lots of swap was available at the
time of these imcidents.)
The memory usgae thoughout the next part of this showed that all ecept about 5
megs of the RAM was being used, and 20 megs of swap was being utilized too.
Last night the system started it's usual lockup and was showing unusally high load
averages. When this happened I was compiling a kernel. I cancelled the compiling
and checked the load average.
Code:
2:31am up 12:25, 1 user, load average: 3.44, 3.49, 3.28
So I shut down apache and mysql ...
Code:
2:45am up 12:39, 1 user, load average: 3.06, 4.99, 4.7
which showed results that seemed pretty normal to me. except that while I was
shutting stuff down the load averge in the 1 minute colum spiked up 4.99.
So finally I shut down most of my other services, nfsd, qmail, cron daemon,
sysklogd and inetd (which was running a CVS pserver).
Code:
2:57am up 12:50, 1 user, load average: 0.58, 1.55, 3.00
Finally things seem like they are starting to improve, but 0.58 is still way
to high for a system that isn't doing anything except handle a single sshd session.
So finally after about a half hour of not touching the system, the load average hit
somewhere in the range of 0.08.
So now I start looking at the current memory usage (which is not very different from what
it was before. except that the swap was down to 1 megabyte. So I decided to see if I could
get any answers by trying to break the system in a controlled fashion.
I then swapped of the swap sspace which took about 15 seconds to do. Immediately me ssh
session died. So I go to the console and see an out of memory error. I decide to continue
screwing around with it.
Code:
total used free shared buffers cached
Mem: 192676 188324 4352 0 356 1060
-/+ buffers/cache: 186908 5768
Swap: 0 0 0
procs memory swap io system cpu
r b w swpd free buff cache si so bi bo in cs us sy id
0 0 0 0 4344 336 1076 62 13 160 103 179 370 9 2 89
3:53am up 13:47, 3 users, load average: 0.00, 0.00, 0.11
14 processes: 13 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 8.9% user, 2.3% system, 0.0% nice, 2.2% idle
Mem: 192676K av, 188788K used, 3888K free, 0K shrd, 348K buff
1504K Active, 2428K Inactive
Swap: 0K av, 0K used, 0K free 1412K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
6826 root 19 0 868 864 680 R 0.8 0.4 0:00 top -c -b -n 1
1 root 8 0 136 132 52 S 0.0 0.0 0:06 init [3]
2 root 9 0 0 0 0 SW 0.0 0.0 0:00 keventd
3 root 19 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU0
4 root 11 0 0 0 0 SW 0.0 0.0 1:00 kswapd
5 root 9 0 0 0 0 SW 0.0 0.0 0:00 bdflush
6 root 10 0 0 0 0 SW 0.0 0.0 0:04 kupdated
7 root 9 0 0 0 0 SW 0.0 0.0 0:00 kreiserfsd
21159 root 9 0 72 72 0 S 0.0 0.0 0:00 dhcpcd eth0
22673 root 9 0 304 304 180 S 0.0 0.1 0:21 /usr/sbin/sshd
19398 root 9 0 712 712 52 S 0.0 0.3 0:00 -bash
16918 root 9 0 68 68 0 S 0.0 0.0 0:00 /sbin/agetty tty1 9600
336 root 13 0 516 516 336 S 0.0 0.2 0:00 /usr/sbin/sshd
18441 root 16 0 996 992 344 S 0.0 0.5 0:00 -bash^M
Lets crash it...
I decided to see if I could allocate any memory that was left into a file.
Code:
mount -t ramfs /dev/ram0 /mnt
cd /mnt
dd if=/dev/zero of=/mnt/memuseup bs=512k count=20
This should have created a 10 megabyte file in memory, but obviously it didn't finish
and dd, bash and my login was killed.
Ok cool, I now have all my memory used up, so I let it sit there until morning to see
if the system would recover any more.
Sleep ......
So today about noon-thirty, I went over to the console and there was no recovery, there
was more memory being used up, because agetty was dying with an out of memory error and
then respawning
Any help any one could offer is much appreciated because I have no idea what to do next.
Sorry for the long post but I wanted to provide you with as much information as I could.