I've got a Centos 5.7 running Magento with nginx. I also got there 10GB of Swap. But the os never use it. How can i make it work?
Asked
Active
Viewed 1,456 times
1
-
Begin running out of RAM and CentOS will start using it. Although at that point you may have some problems... – qweet Feb 27 '12 at 09:47
-
You don't EVER want to use your swap, it is a safety net when you run out of RAM, nothing more. – Ben Lessani Mar 12 '12 at 00:09
2 Answers
3
This article about swap from Tony Kay in the Linux Journal is the best I've ever read on the subject: http://www.linuxjournal.com/article/10678
If you're interested to know the details of how swap space is used, you should give it a read.
![](../../users/profiles/107694.webp)
Luis Fernando Alen
- 540
- 1
- 5
- 11
1
It's not because you have swap it will automatically be used. It has been reported as a bug before on centos 6, but it was ruled as not a bug. You only need to be concerned when your memory is full, and your swap is not being used. At that point, as stated by qweet, you will have some bigger problems to worry about.
The OS knows when to use swap.
![](../../users/profiles/86280.webp)
Lucas Kauffman
- 16,818
- 9
- 57
- 92
-
2The OS is smart enough to know when it makes sense to use swap and when not to. If you think you know better, you can turn up the [swappiness](http://unixfoo.blogspot.com/2007/11/linux-performance-tuning.html). – David Schwartz Feb 27 '12 at 10:26