Re: heavy swapping, not sure why - Mailing list pgsql-general

From Merlin Moncure
Subject Re: heavy swapping, not sure why
Date
Msg-id CAHyXU0zRrAuudU-fxWB9uLxiO7875DKa8a8yhKz7vkfbXauV2w@mail.gmail.com
Whole thread Raw
In response to Re: heavy swapping, not sure why  (Lonni J Friedman <netllama@gmail.com>)
List pgsql-general
On Tue, Aug 30, 2011 at 5:05 PM, Lonni J Friedman <netllama@gmail.com> wrote:
> On Tue, Aug 30, 2011 at 2:55 PM, John R Pierce <pierce@hogranch.com> wrote:
>> On 08/30/11 12:18 PM, Tom Lane wrote:
>>>>>
>>>>>            total       used       free     shared    buffers     cached
>>>>> >>  Mem:         56481      55486        995          0         15
>>>>> >>  53298
>>>>> >>  -/+ buffers/cache:       2172      54309
>>>>> >>  Swap:         1099         18       1081
>>>>
>>>> >  This is totally uninteresting.
>>>
>>> Yeah.  You're going to need a whole lot more than 17MB of bloat before
>>> it'll be possible to tell which process is at fault, given that the
>>> expected process sizes are up to 10GB.
>>
>> indeed, its 100% normal for the linux virtual memory manager to write
>> 'dirty' pages to the swapfile during idle time.
>
> Sure, but it shouldn't grow indefinitely?

no it should not (and it can't -- you've only reserved so much space).
  however 35mb swap is incredibly low.  on my linux workstation vm
I've got 176mb used with nary an issue -- it fluctuates a lot
depending what happens to be going on at the time (a workstation
includes a lot of high memory low activity processes like gnome-panel
which tend to swap out).  had I disabled swappiness, that would have
reduced memory available to do stuff with rather drastically.

btw symptoms of swap thrashing are 100% full swap volume, extremely
high iowait, low/no memory used for file caching, process(s) with high
non shared resident memory usage, and, depending on how serious your
situation is and how linux is configured, OOM errors and/or randomly
killed processes.  for systems not under extreme memory stress
(including yours, at least at the moment) it's main purpose is to make
sure some processes doesn't gobble up memory and sit on it.

merlin

pgsql-general by date:

Previous
From: Ben Chobot
Date:
Subject: regression between 8.4.8 and 8.4.2?
Next
From: Fujii Masao
Date:
Subject: Re: FATAL: terminating connection due to conflict with recovery