Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi,
I saw some threads discussing how to clear the disk cache, but is it possible to configure the system not to use disk cache at all? How is that done?
Thanks.
If I'm not mistaken this command addresses only SCSI devices. I am looking for a way to configure the system not to use cache at all (e.g. set the cache size to 0) that will work whatever memory I'm using (e.g. USB, RAM only).
If I'm not mistaken this command addresses only SCSI devices. I am looking for a way to configure the system not to use cache at all (e.g. set the cache size to 0) that will work whatever memory I'm using (e.g. USB, RAM only).
Thats correct (although linux seems to denote all disks as scsi now, even if technically some should be hd*) so using sdparm should disable the write cache of the drives.
The following link, and its referenced links, may provide some insight to linux kernel cache as thats way beyond my knowledge.
is it possible to configure the system not to use disk cache at all?
No (presuming you are talking about the page-cache).
Questions such as this generally indicate an insistence on a perceived answer - usually an incorrect one.
What is the problem you are trying to solve ? - the problem, not symptoms.
I am working on an embedded system that has no disk of its own, but may have USB inserted. so there are two problems I'm looking for answers:
1. I'm not sure what is the actual meaning of swapping when there is no disk at all
2. I want to test how much RAM I actually need for operation.
these two issues lead me to disabling the cache - at least for testing.
Linux will work fine without swap at all - so long as you have sufficient memory (RAM). Swap is merely "overflow" for RAM.
Page-cache (what you see as cached in "free") is merely a convenient use for otherwise unused RAM. If otherwise needed (by userland applications) the page-cache is released. Automagically.
I suspect you are worrying unnecessarily.
Calculating how much memory your processes need is more "black art" than science. Even the kernel devs haven't pinned that one down satisfactorily. I'll get back to you with some suggestions - presuming you have a full set of tools available (/proc, /sys, perl ... that sort of thing).
Rather than re-hash the old threads about how to account memory, go get ps_mem.py
Works the way I generally think it should, and the imbedded comments are informative background - as well as the python code itself of course.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.