(VM)Kernel prefers swapping instead of releasing cache memory or Red Hat 9 Memory Management Issue
"Dave Warchol" <[email protected]> Tue, 27 Jan 2004 09:20:38 -0500
| Newsgroups | gmane.linux.admin.managers |
|---|---|
| Message-ID | <[email protected]> |
All: A while back I posted a message about what I thought was strange behavior relative to memory management by RH 9 Kernel (kernel-smp-2.4.20-20.9). This box is an Apache (mod_perl) web server also running PostgreSQL. The symptoms were that free memory would decrease over a period of time, buffers and cache would increase to the extent that freespace was consistently 10% or less of physical memory. At that point, we'd start to eat into swap. During times of "bursty" demand two things happens: - Apache would be busy spawing children, and, - We'd eat into swap to the extent that the box was spending all of its time managing memory, and Eventually we'd hit maxclients on apache (because he couldn't respond to requests) and things would be at a standstill until either restarting Apache or rebooting the box. It is a production system, so not a good situation. - Also, cache/buffers didn't appear to be released when required. If I understand things correctly, the newer kernels are supposed to use as much cache/buffers as is available (good thing for performance), however, it should release it if requested. In earlier kernel versions you could tune freepages, this feature is no longer available. Adjusting the parameters vm.bdflush and vm.kswapd don't have much impact. The one thing that has made the box more stable during times of "bursty" demand is keeping a larger pool of web server processes (increasing minspareservers and maxspareservers), this reduces Apache's need to spawn as agressively (1 server the first second, 2 the second, up until you're spawing 32/sec). Continuing to poke around I found this on https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=89226 RedHat's site. It describes perfectly the behavior that I am seeing. It appears that the problem was identified on 2003-04-21, but no fix is available to date. BTW, we are also a Novell shop, so with our licensing I am getting some pressure give SUSE a look. Very frustrated at this point: -Dave _______________________________________________ LinuxManagers mailing list - http://www.linuxmanagers.org submissions: LinuxManagers-35TzE1X9F6582KRnZfj+bdi2O/[email protected] subscribe/unsubscribe: http://www.linuxmanagers.org/mailman/listinfo/linuxmanagers