Linode Forum Index Linode Forum
Linode Community Forums
 


Disk cache causing swap usage

Click here to go to the original topic

 
       Linode Forum Index -> Performance and Tuning
Author Message
looper



Joined: 04 Dec 2011
Posts: 3

Posted: Sun Dec 04, 2011 2:57 pm    Post subject: Disk cache causing swap usage  

Hello,

I hope one of you can help me out here.

I'm having a hard time figuring out why my linode is swapping. Around 80% memory is going to disk cache, so I thought it would be logical to release a bit of that instead of swapping.

Take a look at this munin-graph:



When all free memory has been eaten by disk cache, it starts to swap. It shouldn't be like that, right?

I'm running:

3.0.4-linode38
Ubuntu 10.04.3 LTS
PHP, Apache, Mysql

I haven't touched vm.swappiness (still at 60).

Any ideas?

- Magnus
Back to top  
hybinet



Joined: 02 May 2008
Posts: 1058

Posted: Sun Dec 04, 2011 8:01 pm    Post subject: Re: Disk cache causing swap usage  

looper wrote: Around 80% memory is going to disk cache, so I thought it would be logical to release a bit of that instead of swapping.
Your kernel disagrees.

If the disk is frequently accessed but there are some idle apps, it makes more sense for the kernel to swap out the idle apps instead of sacrificing disk performance. Besides, you're only swapping a few kilobytes per second, compared to several gigabytes of disk cache. Nothing to worry about.
Back to top  
looper



Joined: 04 Dec 2011
Posts: 3

Posted: Mon Dec 05, 2011 8:28 am    Post subject:  

Hi hybinet

You got a point there. I don't like the idea that machinery disagrees with me, though.

Thanks for your response.

- Magnus
Back to top  
Stever



Joined: 07 Dec 2007
Posts: 337
Location: NC, USA

Posted: Mon Dec 05, 2011 9:19 am    Post subject:  

looper wrote: I don't like the idea that machinery disagrees with me, though.
looper wrote: I haven't touched vm.swappiness (still at 60).

It is doing what you told it to do by leaving swappiness at the default. If you would rather lose disk cache than swap, then change the setting lower.
Back to top  
Guspaz



Joined: 26 May 2009
Posts: 1150
Location: Montreal, QC

Posted: Mon Dec 05, 2011 10:09 am    Post subject:  

http://www.linuxatemyram.com/
Back to top  
Emufarmers



Joined: 07 Jan 2010
Posts: 19

Posted: Mon Dec 05, 2011 7:47 pm    Post subject:  

Guspaz wrote: http://www.linuxatemyram.com/
Nobody's registered linuxatemyswap.com yet? :(
Back to top  
 
       Linode Forum Index -> Performance and Tuning
Page 1 of 1