Swap usage when memory is available ..

````
[root@linode ~]# free -m
total used free shared buffers cached
Mem: 498 442 56 0 25 119
-/+ buffers/cache: 297 200
Swap: 511 125 386

````

I am on 512 linode hosting around 30 websites and email domains. Average bandwdith usage is 1GB per day.

Can someone tell me why swap space is used when free and cached memory is available?

Is amavisd being used for all incoming/outgoing emails?

Thanks

Richard

2 Replies

There is a Linux kernel tuning parameter for swapping, amusingly and aptly name "swappiness", that is discussed here:

http://kerneltrap.org/node/3000

and here:

https://help.ubuntu.com/community/SwapFaq

I have swappiness on my linode set to 100, which works well for me. Even with the parameter set to zero, some swapping will still occur.

James

The logic is that unused or seldom-used RAM is wasted RAM. The kernel will swap out stuff that isn't actively used, and use the freed RAM for caching and other useful things.

There should be a net performance gain, unless you have a strange usage pattern, in which case adjusting swappiness can help.

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