On Thu, 14 Mar 2002, Bill Marrs wrote: > > >It's copy-on-write. The swap is a write-to-disk. > >There's no such thing as sharing memory between one process on disk(/swap) > >and another in memory. > > agreed. What's interesting is that if I turn swap off and back on again,
what? doesn't seem to me like you are agreeing, and the original quote doesn't make sense either (because a shared page is a shared page, it can only be in one spot until/unless it gets copied). a shared page is swapped to disk. It then gets swapped back in, but for some reason the kernel seems to treat swapping a page back in as copying the page which doesn't seem logical ... anyone here got a more direct line with someone like Alan Cox? That is, _unless_ you copy all the swap space back in (e.g. swapoff)..., but that is probably a very different operation than demand paging. > the sharing is restored! So, now I'm tempted to run a crontab every 30 > minutes that turns the swap off and on again, just to keep the httpds > shared. No Apache restart required! > > Seems like a crazy thing to do, though. > > >You'll also want to look into tuning your paging algorithm. > > Yeah... I'll look into it. If I had a way to tell the kernel to never swap > out any httpd process, that would be a great solution. The kernel is > making a bad choice here. By swapping, it triggers more memory usage > because sharing removed on the httpd process group (thus multiplied)... the kernel doesn't want to swap out data in any case... if it does, it means memory pressure is reasonably high. AFAIK the kernel would far rather drop executable code pages which it can just go re-read ... > > I've got MaxClients down to 8 now and it's still happening. I think my > best course of action may be a crontab swap flusher. or reduce MaxRequestsPerChild ? Stas also has some tools for causing children to exit early if their memory usage goes above some limit. I'm sure it's in the guide. > > -bill > ---------------------------------------------------------------------- [EMAIL PROTECTED] | Courage is doing what you're afraid to do. http://BareMetal.com/ | There can be no courage unless you're scared. | - Eddie Rickenbacker