Moving Swap file

Andy Graybeal andy.graybeal at casanueva.com
Tue Mar 15 15:14:51 UTC 2011


On 03/15/2011 10:00 AM, J wrote:
> On Tue, Mar 15, 2011 at 09:00, Andy Graybeal
> <andy.graybeal at casanueva.com>  wrote:
>> Hello,
>> I'd like to move our swap file onto our RAID array.
>
> Might I ask why you'd want to do this?
>
> Don't get me wrong, I'm not necessarily trying to dissuade you from
> doing so, but in general, you shouldn't really see any benefit to
> moving swap onto an external RAID enclosure, at least not enough
> benefit to make it worthwhile.
>
> If you're using only a little swap, then you'd be better off looking
> into performance tuning and such.  If you're using swap space
> constantly, then it's probably time to look into either improving the
> hardware (more ram predominately) or getting a new server and
> offsetting some of the work.  Swap space is fine to use, but it's
> incredibly slow when your system has to start swapping memory pages on
> and off disk, and so, IMHO, in a production system it's better in the
> long term to solve the problem of why you're hitting swap to begin
> with.
>
> But that's just my opinion.
>
> As for your actual question... are buddleia and data two separate
> LVMs?  ANd how much swap do you have right now?  (running the Free
> command will show this)
>
> So I'm getting back to the "Do you even need to worry about it" question.
>
> Cheers,
>
> Jeff
>


Jeff, thanks for the "big idea" questions.  I'm topped out at 8GB of ram 
on our server.  Long term, your right, it would be good to consider 
getting another machine.

Here's what 'free' says:
root at buddleia:~# free
              total       used       free     shared    buffers     cached
Mem:       8192972    8036204     156768          0     297424    1756296
-/+ buffers/cache:    5982484    2210488
Swap:      7831544       9816    7821728
root at buddleia:~#

As far as your questions about the LVM's... I have no idea, I set it all 
up this past August.  I would probably know the answer back then.  I get 
confused when it comes to LVM anyway.

The reason I want to move the swap file to he RAID array is because I 
felt really bad for the HD that has the swap partition on it now... and 
I figured it'd be best to share some of the load, and RAID is supposed 
to be faster.  I don't think it matters, but to be clear the array isn't 
external.

I've been hearing complaints about the box "slowing down" recently ... 
it happened yesterday when there was nothing swapped out (I had just 
rebooted the box because of a kernel update that morning).  But I've 
seen the swap get to be about 4GB and we've had to wait a bit while the 
swap sorts things out for us.

Yesterday when the slow-down happened. I hurriedly went into htop to see 
what was up; like I said no swap usage, and no CPU's maxed out.. I had 
no idea why it was so slow.

I was thinking about moving the swap as a precaution hoping to gain some 
performance from it.

What is this performance tuning you speak of?  Is this swappiness?  I 
just read about this in the SwapFaq.

Keep the "big idea" questions coming if you see fit, I like to hear the 
ideas.  I need it.

-Andy




More information about the ubuntu-users mailing list