Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Our server is performing decently, but when backups or other scan processes run it will tank the entire server. Something like clamd will run and scan many files. While we expect slow performance, it's killing our cache and the end result is we don't get a system that can do anything.

Is there a way to disable disc/disk caching for a single command? The idea would be to run it like this:

# ./nocache clamd

Then while running clamd it would not thrash the primed cache while reading all the files on the system.

share|improve this question
up vote 2 down vote accepted

It has to be implemented in the program itself. If clamd doesn't already do it, you can modify clamd to avoid an unnecessarily large cache footprint by adding calls to functions like posix_fadvise(... POSIX_FADV_NOREUSE) or madvise(... MADV_DONTNEED) (if it memory maps the files). It will still push filesystem metadata out of the cache though. There's not much you can do about that.

share|improve this answer
Sad we don't have a user-level way, but thanks for the information. A madman could use a hook or create a process that executes the other code having called this POSIX function (or use LD_LIB) – Kristopher Ives Nov 29 '11 at 23:22

Its not really the answer you are looking for but we just use ionice for backups and scans so they don't affect the other programs on the server.

ionice -c3 clamd
share|improve this answer

Your Answer


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.