Running 6.0-release, with 2 gig ram. Typical memory stats like this (from top): 626M Active, 1045M Inact, 204M Wired, 75M Cache, 112M Buf, 22M Free Under moderately high load i'm seeing a lot of swapping periodically through the day (and then load avg going way, way up, of course). I'm wondering why is there, with so much inactive memory, so much disk swapping? The machine runs some fairly intense stuff, such as squid, postgresql, and zope; but it seems to me there should be enough RAM to cover all of this without swapping. What am I missing? Am i misinterpretting the stats, and just not understanding how the vm works? -- Tim Middleton | Vex.Net | There is a wisdom that is woe; but there x@veX.net | VexTech.ca | is a woe that is madness. --Melville (MD)
On Thu, 18 May 2006 07:33:07 -0400 Tim Middleton <x@vex.net> wrote:> > Running 6.0-release, with 2 gig ram. Typical memory stats like this (from > top): > > 626M Active, > 1045M Inact, > 204M Wired, > 75M Cache, > 112M Buf, > 22M Free > > Under moderately high load i'm seeing a lot of swapping periodically through > the day (and then load avg going way, way up, of course). I'm wondering why > is there, with so much inactive memory, so much disk swapping? > > The machine runs some fairly intense stuff, such as squid, postgresql, and > zope; but it seems to me there should be enough RAM to cover all of this > without swapping. What am I missing? Am i misinterpretting the stats, and > just not understanding how the vm works? > > -- > Tim Middleton | Vex.Net | There is a wisdom that is woe; but there > x@veX.net | VexTech.ca | is a woe that is madness. --Melville (MD) >maybe you have to set vm.swap_idle_enabled=0 or vm.swap_enabled=0 ? -- Best regards. Alexander "polachok" Polakov
>>>>> "Tim" == Tim Middleton <x@vex.net> writes:Tim> Running 6.0-release, with 2 gig ram. Typical memory stats like Tim> this (from top): Tim> 626M Active, 1045M Inact, 204M Wired, 75M Cache, 112M Buf, 22M Tim> Free Tim> Under moderately high load i'm seeing a lot of swapping Tim> periodically through the day (and then load avg going way, way Tim> up, of course). I'm wondering why is there, with so much inactive Tim> memory, so much disk swapping? Tim> The machine runs some fairly intense stuff, such as squid, Tim> postgresql, and zope; but it seems to me there should be enough Tim> RAM to cover all of this without swapping. What am I missing? Am Tim> i misinterpretting the stats, and just not understanding how the Tim> vm works? Swapping in or out? Sswapping out is normal behaviour --- a background kernel thread sweeps memory to move it from active to inactive and inactive dirty pages are occaisionally sent to swap (or the file that's backing them). Swapping in is also normal when processes are launched. Remember that *BSD's "swap in" processes. I believe that mmap() calls also show up in the swap stats ... Swapping doesn't mean what it used to. What should worry you is a process that is blocked to a large degree on paging --- but that's not likely happening. Dave. -- ===========================================================================|David Gilbert, Independent Contractor. | Two things can be | |Mail: dave@daveg.ca | equal if and only if they | |http://daveg.ca | are precisely opposite. | =========================================================GLO================
On Thu, 18 May 2006 13:33:07 +0200, Tim Middleton <x@vex.net> wrote:> > Running 6.0-release, with 2 gig ram. Typical memory stats like this (from > top): > > 626M Active, > 1045M Inact, > 204M Wired, > 75M Cache, > 112M Buf, > 22M Free > > Under moderately high load i'm seeing a lot of swapping periodically > through > the day (and then load avg going way, way up, of course). I'm wondering > why > is there, with so much inactive memory, so much disk swapping? > > The machine runs some fairly intense stuff, such as squid, postgresql, > and > zope; but it seems to me there should be enough RAM to cover all of this > without swapping. What am I missing? Am i misinterpretting the stats, and > just not understanding how the vm works?What is the memory use of your applications? Reported by top (SIZE and RES) or by ps. How much (different) data from/to disk is being processed by your applications in what time interval? Ronald. -- Ronald Klop Amsterdam, The Netherlands
Thanks for the tips, all who responded (including a few who responded via email-only --- Kris, thanks for not just calling me an idiot outright. <-; BTW, thanks for your BSDCan presentation ... really motivated me to try to get the 5.x boxes I have in production upgraded! I'll say no more...). This was a false alarm. The box in question is being monitored fairly closely with some home-brew rrdtool graphs, and there was a definite corelation between the load and the paging graphs. The problem was confusion regarding the *scale* of the graph. The rrdtool graphs add an "m" to indicate the numbers are in the "millis", when the frequency scale is less than 1 (per second), rather than using decimal places. This was not noticed. So the massive swapping was actually miniscule. Sorry about that. (-: The real slow down is probably simply due to just too many heavy parallel database queries. -- Tim Middleton | Vex.Net | There is a wisdom that is woe; but there x@veX.net | VexTech.ca | is a woe that is madness. --Melville (MD)