On Tue, Sep 4, 2012 at 11:53 AM, Dale <rdalek1...@gmail.com> wrote:
> Alan McKinnon wrote:
>> On Tue, 04 Sep 2012 09:15:31 -0500
>> Dale <rdalek1...@gmail.com> wrote:
>>
>>> I think the new method for determining swap is to use what makes sense
>>> and not the old rule of 'twice the ram'.
>> Alan's new rule of swap is:
>>
>> If you ever use swap as swap at all, find out how your machine is
>> misconfigured. When my 16G is "not enough" anymore, something is badly
>> wrong and it isn't not enough RAM and I need swap to wiggle around
>> in :-)
>>
>> I think the 2 x RAM rule stopped being applicable when the average
>> machine got to more than 16M. Some old memes are like zombies - very
>> hard to kill.
>>
>> This laptop has a "swap" partition, but it's not for swap, it's for
>> hibernate. And I never use it, it takes longer to come out of hibernate
>> than to just boot up from cold! These days I just suspend.
>>
>> None of this changes the fact that the kernel still does get upset when
>> it has no swap at all (even just a little bit). But that doesn't mean
>> we should still be using it as full-blown swap.
>>
>>
>>
>
>
> Yup.  I have swap but I have it set to where it won't use it unless it
> is REALLY bad.  I have swappiness set to like 20 or something.  It will
> fill up my ram with cache and such but it rarely uses more than a few
> hundred kilobytes of swap.  When I see it using that, I usually kill
> swap and add it back.  I just don't like a machine with 16Gbs of ram
> using swap at all.  I have thought about setting it to 10.  Maybe then
> it will leave it alone until it really hits the fan.  ;-)

Set swappiness to 0. Swap will be used if and only if absolutely necessary.

Also, you're unlikely to notice a performance hit if the amount of
data in swap is only a few tens of megabytes; the seek-and-read rate
of even spinning platter disks should tend to cause that bit of
latency to get lost in the normal noise of library linkage, data file
loading, etc. (heck, it might even still be in the drive cache) The
performance hit is there, but probably not subjectively noticeable.

>
> That said, I did roll over one night and notice that the CPU was going
> ape.  I got up and into my chair to notice it was using almost all the
> ram and was starting to use a bit of swap.  I switched to a console, ran
> htop and noticed that some KDE process was using about ~15.5Gbs of ram.
> It was crazy to see.  I couldn't get it to die with kill -15 so I did a
> kill -9.  I guess it had to know I really wanted it dead.  It has not
> happened since so no clue on why it did that.  Heck, it ran the same
> version of KDE for a good while and still didn't do it.  Cosmic rays
> from Mars I guess.
>
> I would recommend at least 500Mbs or so of swap regardless of ram tho.
> Some swap is a good idea.  Just try not to use it since it is dog slow.

Indeed.

> If you are using hibernate/suspend thingys then that is different.
> Isn't that when it has to be at least as much swap as you have ram?

Yes.

-- 
:wq

Reply via email to