[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Interview with Con Kolivas on Linux failures




On Jul 24, 2007, at 2:41 PM, Mike McCarty wrote:
I've found Linux using up to about 60% of my memory
for "disc cache". This, I trow, is part of the problem.

There's been much debate about this among kernel developers, I understand. On one side there are people who point out (quite correctly) that programs often allocate memory that goes unused most of the time, and this memory can be better used as disk cache. On the other side there are people who point out, also quite correctly, that swapping out a program can cause interactivity problems.

The ultimate result of this was the addition of a "swappiness" knob to 2.6 kernels to allow people to tune this to their taste. More here:
http://kerneltrap.org/node/3000

Ultimately I don't think there's any one answer. On my NFS server, I don't want processes that are asleep most of the time hogging memory that could be used for disk cache. But on my desktop machine, I don't want a temporarily idle Firefox session swapped to disk only to be swapped back in a few minutes later.

Generally I think recent 2.6 kernels strike a pretty good balance. I haven't felt the need to tweak swappiness on my desktop machine from the default of 60, but it's also got 1 gigabyte of RAM. Given cheap RAM prices these days, sometimes it's easiest just to put in RAM until the system stops swapping. ;) A quick check shows that that system, which has been up a full day, is using a grand total of 152 Kbytes of swap.

The scheduler makes this decision, not nice. Nice simply informs the
scheduler what is considered to be fg vs bg.

Yeah, right after I sent the message I realized that was poorly worded. But I decided you'd get what I meant, and sending a correction after it would be unnecessary spam. :)

I'm actually surprised you're able to get background tasks to run well on XP with such a small amount of RAM. My experience with XP is that with anything less than 512 megabytes of RAM, even the screen saver turning on can cause long periods of disk thrashing. I've drummed my fingers for minutes at a time on such machines waiting for XP to stop running the screen saver and give me my desktop back.

I haven't experience minutes of wait, but certainly seconds with XP.

It depends on what else is running. If there's another process consuming a lot of CPU or using the disk heavily, XP's UI slows to a crawl. I think my record was something like 20 minutes to return from the screensaver on a system that had some kind of popup adware program running. I could literally watch it draw each UI element individually.





Reply to: