Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
vm.bdflush = 100 1200 128 512 15 5000 500 1884 2
vm.dirty_ratio = 20
vm.dirty_background_ratio = 10
vm.swappiness = 10
vm.min_free_kbytes = 300000

That means that the MOST dirty data that can be in RAM is 20% and that there will always be 300MB RAM that linux CANNOT use to cache files right?

What I am trying to do is ensure that there is always room left for service to spawn and use RAM. I have 8GB of ram and hosting websites with PHP so I want to have more free RAM on stand by instead of seeing myself on 50MB of RAM free.

I read that a very low background_ratio and a higher dirty_ratio was better performance?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

You're thinking about this completely wrong. Free RAM does you no good. If you have 300MB free, that just means there's 300MB you are not using. You should want as little free RAM as possible because that means as much RAM as possible is doing useful work.

You want min_free_kbytes as low as you can possibly get away with so that you can use your RAM rather than having it sitting around doing nothing.

You must be thinking "I want free RAM so I can use it later". But now is later than it was before. And if you use it now, you can also use it later. All that happens if you don't use it now is that you forever lose the opportunity to use it now. Later never comes -- it's always now. Use the RAM now. Don't save it for later because then later you'll want to save it for later too.

It's not like if you use 4GB now you can use 12GB later. If you use 7GB now, all that happens it that 1GB went to waste. You want as little free RAM as possible so your system can get the most benefit from the RAM you have. You can't save RAM. The opportunity to use that RAM now must be used now or it's forever lost.

Limiting dirty pages does make sense because dirty pages cannot be used for another purpose until the contents are written to disk. This can cause the system to be forced to use RAM ineffectively or to do very large bursts of I/O. However, I don't think you really need to adjust the defaults. They're pretty smart.

share|improve this answer
    
Yea, that's what I know. You want RAM to be used. However, using a custom kernel which is still a little glitchy so I'm trying to ensure there is more ram free to avoid I/O issues(not from swap) from a spike which causes high load averages. So just trying to remove dirty pages sooner so when a spike comes there is RAM left. Took out the min_free. –  Tiffany Walker Nov 14 '12 at 15:51
    
You got it. You only need to limit dirty pages to ensure there is RAM that can be made free for a normal load spike. Clean pages are not a problem. –  David Schwartz Nov 14 '12 at 16:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.