0

if i play those command :

sync
echo 3 > /proc/sys/vm/drop_caches

Will the server be force to read the correct file on disk until i put 0 again ?

Or this work only one time, and if i want to clear cache again, i've to put 0 and 3 again ?

Thanks

2 Answers 2

2

No - that just drops the existing caches. As soon as you start reading files, linux will start caching them again.

There shouldn't be a scenario in which linux reads "old" data from a disk cache though, if that's what you are worried about.

0
0

You don't need that kind of wizardy. Linux will cache files it reads, but a write operation invalidates the cache entry for that file and it will be read again from disk during next read access.

1
  • indeed, I am concerned about the Op's motive. I can see why you might want to do this (eg. performance testing assuming cold cache)... but these are few and far between
    – Tom Newton
    Aug 23, 2012 at 12:35

You must log in to answer this question.

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