Files
kata-containers/cli
Julio Montes 07db945b09 virtcontainers/qemu: reduce memory footprint
There is a relation between the maximum number of vCPUs and the
memory footprint, if QEMU maxcpus option and kernel nr_cpus
cmdline argument are big, then memory footprint is big, this
issue only occurs if CPU hotplug support is enabled in the kernel,
might be because of kernel needs to allocate resources to watch all
sockets waiting for a CPU to be connected (ACPI event).

For example

```
+---------------+-------------------------+
|               | Memory Footprint (KB)   |
+---------------+-------------------------+
| NR_CPUS=240   | 186501                  |
+---------------+-------------------------+
| NR_CPUS=8     | 110684                  |
+---------------+-------------------------+
```

In order to do not affect CPU hotplug and allow to users to have containers
with the same number of physical CPUs, this patch tries to mitigate the
big memory footprint by using the actual number of physical CPUs as the
maximum number of vCPUs for each container if `default_maxvcpus` is <= 0 in
the runtime configuration file,  otherwise `default_maxvcpus` is used as the
maximum number of vCPUs.

Before this patch a container with 256MB of RAM

```
              total        used        free      shared  buff/cache   available
Mem:           195M         40M        113M         26M         41M        112M
Swap:            0B          0B          0B
```

With this patch

```
              total        used        free      shared  buff/cache   available
Mem:           236M         11M        188M         26M         36M        186M
Swap:            0B          0B          0B
```

fixes #295

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-05-14 17:33:31 -05:00
..
2018-04-30 10:53:08 -07:00
2018-04-30 10:53:08 -07:00
2018-04-30 10:53:08 -07:00
2018-04-25 09:07:34 -07:00
2018-04-30 10:53:08 -07:00
2018-05-08 07:26:38 -05:00
2018-04-30 10:53:08 -07:00
2018-04-30 10:53:08 -07:00
2018-04-30 10:53:08 -07:00
2018-04-30 10:53:08 -07:00
2018-04-30 10:53:08 -07:00
2018-04-26 11:39:20 +01:00
2018-04-26 11:39:20 +01:00
2018-04-17 14:38:00 +00:00
2018-04-17 14:38:00 +00:00
2018-04-30 10:53:08 -07:00
2018-04-30 10:53:08 -07:00
2018-05-08 07:26:38 -05:00
2018-05-08 07:26:38 -05:00