-2

Trying to avoid some issues so I've been trying to learn vm. in kernel tuning but still a little confused even after googling. The lower background_ratio is the sooner the flushes? the lower dirty_ratio is the less dirty ram that is kept, right

vm.dirty_ratio = 20
vm.dirty_background_ratio = 1

or

vm.dirty_ratio = 60
vm.dirty_background_ratio = 20

or

vm.dirty_ratio = 20
vm.dirty_background_ratio = 10

or

vm.dirty_ratio = 20
vm.dirty_background_ratio = 5

1 Answer 1

6

You don't have an unusual use case, or if you do, you haven't mentioned it. So there's no reason to change any settings from their defaults. When there's a "make everything better at no cost" switch, it comes in the "on" position.

Also, free RAM is bad. Free RAM is 100% waste. It's not like if you use less RAM now you can use more RAM later. If you have 1GB free now, you are forever losing the opportunity of using that 1GB.

You're thinking "free RAM is good now because I can use it later". But this is silly. You can use the RAM later whether it's free now or not. RAM that's free now is just RAM you didn't use. And if you could have used it, then you wasted it by keeping it free. So if you make more free RAM, when that RAM could have been used, you're just asking for more waste.

The analogy I sometimes use is a factory manager who walks into a warehouse where all the employees are busily working and says, "I want some employees sitting on the couch, so they're ready in case we need them". But that makes no sense. He should say, "I want all my employees doing work, if there's any work they can possibly do. Nobody sits on the couch unless there's no way they can possibly do anything useful at all".

Asking for "more free RAM" is like walking into the factory and asking the employees to sit down on a couch instead of working so they'll be ready to do work just in case there's work to be done.

3
  • 1
    Actually, this mindset is more commonly a result of the endless woes experienced on a certain other OS, that wasn't happy unless a considerable percentage of working memory was always available - because it lies when reporting memory use :)
    – adaptr
    Nov 15, 2012 at 16:47
  • 2
    @adaptr Windows versions prior to Vista were bad and confusing in their memory management. Sadly, this has lead to millions of users who don't understand how their computers use memory. Memory management was rendered sane internally in Windows 7, but the attempt to simplify the management and monitoring has created a confused mess -- it's okay to make something as simple to manage and monitor as possible, but Microsoft tried to make it simpler than that. Nov 15, 2012 at 16:50
  • 2
    The Windows couch is invariably more comfortable than the Linux bench.
    – adaptr
    Nov 15, 2012 at 16:56

Not the answer you're looking for? Browse other questions tagged .