How to drop_caches inside a container?

lxc

(Vladimir Laskov) #1

Hello,
How to drop_caches inside a container?

on host
# lxc --version
2.0.9
# cat /etc/issue
Ubuntu 16.04.2 LTS

on guest (inside container)
# echo 3 > /proc/sys/vm/drop_caches
bash: /proc/sys/vm/drop_caches: Read-only file system


(Stéphane Graber) #2

VM caches are global to the entire system, you can’t drop them for just a single container.
You need to do it as root on the host, which will then flush the cache for the entire system.