Uploaded image for project: 'OpenVZ'
  1. OpenVZ
  2. OVZ-5765

drop_caches: Permission denied in VPS

    Details

    • Type: Feature Request
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Fix Version/s: OpenVZ-legacy
    • Component/s: Containers::Kernel
    • Security Level: Public
    • Environment:
      Operating System: RHEL/CentOS 6
      Platform: All

      Description

      Need to clear the file cache.
      Let's do

      # echo 3 > /proc/sys/vm/drop_caches
      -bash: /proc/sys/vm/drop_caches: Permission denied

      As a result, in order to clear the cache -> must restart VPS


      http://forum.openvz.org/index.php?t=msg&goto=37136&
      http://users.livejournal.com/_winnie/340555.html
      http://serverfault.com/questions/454381/how-to-drop-caches-in-openvz-centos6-container

        Activity

        Hide
        john@5pdx.com John added a comment - - edited

        There is nothing to fix. This is normal behavior under Linux. As it relates to OS-level virtualization, this can only be executed by someone with root access to the hardware node.

        See http://www.linuxatemyram.com/

        Show
        john@5pdx.com John added a comment - - edited There is nothing to fix. This is normal behavior under Linux. As it relates to OS-level virtualization, this can only be executed by someone with root access to the hardware node. See http://www.linuxatemyram.com/
        Hide
        john@5pdx.com John added a comment - - edited

        (In reply to John from comment #1)
        > There is nothing to fix. This is normal behavior under Linux. As it relates
        > to OS-level virtualization, this can only be executed by someone with root
        > access to the hardware node.
        >
        > See http://www.linuxatemyram.com/

        I meant that borrowing memory for disk caching is normal behavior.

        Show
        john@5pdx.com John added a comment - - edited (In reply to John from comment #1) > There is nothing to fix. This is normal behavior under Linux. As it relates > to OS-level virtualization, this can only be executed by someone with root > access to the hardware node. > > See http://www.linuxatemyram.com/ I meant that borrowing memory for disk caching is normal behavior.
        Hide
        kir Kir Kolyshkin added a comment - - edited

        OK, again you neglected to mention you run this inside a container.

        All containers share the same page cache (although there is per-container accounting), so to drop caches of one single container we have to check each page:

        1 Whether it belongs to the container or not – supposing we do have that information, which I am not sure of

        2 Whether this page is used by other containers.

        So, while this is trivial on the host system, it is much less trivial for a container. And this is not a critical piece of functionality – drop_caches is only useful for running various sorts of benchmarks.

        Also note that restarting a container doesn't drop its caches.

        Hope you understand.

        Show
        kir Kir Kolyshkin added a comment - - edited OK, again you neglected to mention you run this inside a container. All containers share the same page cache (although there is per-container accounting), so to drop caches of one single container we have to check each page: 1 Whether it belongs to the container or not – supposing we do have that information, which I am not sure of 2 Whether this page is used by other containers. So, while this is trivial on the host system, it is much less trivial for a container. And this is not a critical piece of functionality – drop_caches is only useful for running various sorts of benchmarks. Also note that restarting a container doesn't drop its caches. Hope you understand.

          People

          • Assignee:
            khorenko Konstantin Khorenko
            Reporter:
            poiuty@lepus.su poiuty
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: