0

I'm using the following commands to flush cache:

# sync; echo 3 > /proc/sys/vm/drop_caches
# sync; echo 2 > /proc/sys/vm/drop_caches
# sync; echo 1 > /proc/sys/vm/drop_caches

When I use one of the above commands, I get the following:

-bash: /proc/sys/vm/drop_caches: Permission denied

My system running CentOS 6.5, I logged in as root via SSH.

Any suggestions?

  • Check what you're typing? It appears as though you've used a ';' where a '>' should be and are trying to execute `/proc/sys/vm/drop_caches'. – Matthew Ife Dec 28 '13 at 13:32
  • Two questions: why do you need to drop your cache? Second, why are you signing in via ssh as root? – EEAA Dec 28 '13 at 13:36
  • 1
    Third question: is this a OpenVZ VPS? – EEAA Dec 28 '13 at 13:44
  • Yes it is OpenVZ. My VPS always running out of memory and goes down. I have 1024 MB memory, hosting 4 websites. They are all inactive and don't have any visits, but when I decide to open WHMCS back-end in one of the websites, the VPS goes down after couple of minutes. Rest other websites are static pages only. That's why I need to find a way to free up some memory. @EEAA – Mina Hafzalla Dec 28 '13 at 15:21
  • This would not solve the problem, even if you could do it. It would only make matters even worse. – Michael Hampton Aug 6 '14 at 4:04
1

Your CentOS is most likely running as an OpenVZ container and as such you don't have access to the host's /proc/sys/vm/drop_caches.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.