Results 1 to 3 of 3
Can anyone help? I’ve been Googling for days and can’t find an answer : (
I need to disable Linux disk buffers/file cache.
You will prob. want to know why ...
- 11-26-2006 #1Just Joined!
- Join Date
- Nov 2006
- Posts
- 2
Disable Linux Disk Buffers
Can anyone help? I’ve been Googling for days and can’t find an answer : (
I need to disable Linux disk buffers/file cache.
You will prob. want to know why I would want to…
I’ve been setting up a diskless PC. This thing boots over the network PXE style using a RAM disk as root.
I spent ages setting things up so that the OS and any software fits perfectly into 448MB (with a few MB left over for temp files etc). The system has 512MB RAM total, so this should leave 64MB to actually run the applications etc (should be plenty).
Thing is, the disk buffer is eating up most/all of this 64MB and (of course?) since it’s using RAM as root anyway, buffering is silly.
(I’ve done some reading and understand that the disk buffer is supposed to resize itself so that it doesn’t interfere with the apps memory allocation, but I’m guessing the buffering system thinks there’s plenty of RAM to play with (maybe not realising the 512MB is really only 64MB)).
Not sure how relevant the distribution is in this case, but if it makes a difference. It’s Debian 3.1 with a 2.6.8 kernel (I recompiled the kernel and am not using any modules).
Any help would be greatly appreciated. And if you can give me a quick fix like: append [diskbuffers=off], I’ll probably kiss you.
Thanks in advance.
Ps:
Computers are what I do, but I’m very new to Linux.
- 11-26-2006 #2
I'm not sure if this will do the trick, but you can try mounting your root filesystem (and other filesystems) with the sync option. This bypasses the write-back cache so that all disk transactions happen in real-time.
Stand up and be counted as a Linux user!
- 11-28-2006 #3Just Joined!
- Join Date
- Nov 2006
- Posts
- 2
I deleted my last message.
The disk cache is limiting itself to a fraction of the available RAM (not the total). (Don’t ask me whether it’s supposed to or not).
I did some more testing. Seems as though the ls –lR / thing slows down if there’s not enough RAM for the buffer (even when it’s reading from RAM anyway).*
This is now more of a matter of interest for me than an urgent problem, but…
Can anyone tell me if a RAM disk root should need buffering? Also, is ext2 the best file system to use for a RAM disk?
s'all v interesting : )
*(Only way I was able to test it without disk buffer was to squash disk buffer out of the way with lots of apps, so it may not be a fair test).


Reply With Quote
