Quote:
Originally Posted by carters2
at the end of the script I added "sync; echo 3 > /proc/sys/vm/drop_caches" to fix it.
|
That was "fixing" something that wasn't broken. Your change probably won't do much harm, but it certainly won't do any good.
I have no guess what is doing a lot of file I/O on your system daily at 4AM. I hope my post won't distract anyone who might have a good guess from jumping in.
Maybe you want to do something that will reduce the amount of cache memory ever taken by your low priority file I/O intensive tasks. Doing so would be difficult and probably would have minimal or negative value, but there is at least some small chance there is some useful adjustment to be made.
But after the low priority task has already used a lot of ram for cache, there is
no benefit to making the cache abruptly give all that memory back. It is easy to do that "fix" but absolutely pointless. Anything run
after the low priority task that wants memory will take as much as it wants from the older cache use. Freeing the memory in advance does nothing to make that memory easier to take.
There are complex behaviors for the priority of ram use when newer demands on the cache contend against older non cache use of memory, and one or the other might win. But when newer non cache memory demands contend against older cache, it is simple: the newer memory demand wins.