3

On a system with huge memory available: 12TB of RAM

echo 3 > /proc/sys/vm/drop_caches 

takes like half an hour to complete.

Does anyone know a faster alternative to drop_caches? I'm using RHEL 6.5 on this server. Do you know if more recent RHEL (like 6.6+ or 7+) improves drop_caches speed ?

chicks
  • 3,639
  • 10
  • 26
  • 36
  • 4
    Why are you running this command? X-Y Problem? Can you give some context? – ewwhite Oct 14 '16 at 11:48
  • 2
    I'm running this command to empty my cache in order to test the performance of my system and I don't want to use pre-cached data but want to read it again. –  Oct 14 '16 at 13:46

2 Answers2

3

If you need to reset the system after a test run, why not quick reboot using kexec-reboot?

This would probably reboot the server in 45-60 seconds, and is a much cleaner approach to what you're doing.

Also see: Is it possible to reboot a Linux OS without rebooting the hardware?

ewwhite
  • 194,921
  • 91
  • 434
  • 799
-1

The faster alternative is to remove ram.

The only thing I could think of dropping caches is for test purposes. Or what is your use case? Remember, this doesn't drop the cache completely. As soon as the command has been executed it starts over again to use caching.

/HP/