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

OpenVZ7 CT uses node SWAP instead of virtual SWAP into RAM.

    XMLWordPrintable

    Details

      Description

      >Description of problem:
      As described in OpenVZ7 documentation "When the container exceeds the RAM limit set for it, the swapping process starts. The swapping process for containers slightly differs from that on a standalone computer. The container swap file is virtual and, if possible, resides in the Node RAM." But in reality it start using Node swap, even if Node has plenty of free RAM.

      >How reproducible:
      Try to use all RAM in CT to initiate swaping.

      >Steps to Reproduce:
      1. [root@node ~]# prlctl create MyCT --vmtype ct --ostemplate centos-7-x86_64
      2. [root@node ~]# prlctl set MyCT --memsize 1G --swappages 512M
      3. [root@node ~]# prlctl start MyCT
      4. [root@node ~]# prlctl enter MyCT
      5. CT-7d998a54 /# mount -t tmpfs -o size=2G tmpfs /mnt
      6. CT-7d998a54 /# dd if=/dev/urandom of=/mnt/testfile bs=1M count=1200
      7. CT-7d998a54 /# free -m
                    total used free shared buff/cache available
      Mem: 1024 42 0 916 981 0
      Swap: 512 284 227
      8. [root@node ~]# free -m
                    total used free shared buff/cache available
      Mem: 257658 2456 253233 926 1967 253202
      Swap: 32768 288 32480

      >Actual results:
      [root@node ~]# free -m
                    total used free shared buff/cache available
      Mem: 257658 2456 253233 926 1967 253202
      Swap: 32768 288 32480


      >Expected results:
      [root@node ~]# free -m
                    total used free shared buff/cache available
      Mem: 257658 2456 253233 926 1967 253202
      Swap: 32768 0 32768
      >Host OS:

      >Guest OS:
      No matter

      >Additional info (see https://openvz.org/Reporting_OpenVZ_problem):
      I also have tried to completely disable swap on Node, after that CT was unable to SWAP at all. For comparison Openvz6 swap works inside CT even if Node has no SWAP at all.

        Attachments

          Activity

            People

            Assignee:
            khorenko Konstantin Khorenko
            Reporter:
            wyckaooo Witto
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: