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:

~~![](<URL url=)http://i.imgur.com/pVtXj.png" />

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~~

5 Replies

@looper:

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.

Hi hybinet

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

Thanks for your response.

  • Magnus

@looper:

I don't like the idea that machinery disagrees with me, though.
@looper:

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.

http://www.linuxatemyram.com/

@Guspaz:

http://www.linuxatemyram.com/
Nobody's registered linuxatemyswap.com yet? :(

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct