[lxc-devel] [lxd/master] Clarify unsquashfs limit logic
stgraber on Github
lxc-bot at linuxcontainers.org
Thu Sep 15 21:53:03 UTC 2016
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160915/b2f13955/attachment.bin>
-------------- next part --------------
From 74782d8944734125f44038ef811f8bc302d42b3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 15 Sep 2016 17:52:27 -0400
Subject: [PATCH] Clarify unsquashfs limit logic
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
lxd/images.go | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lxd/images.go b/lxd/images.go
index 70b33e6..66ea2ba 100644
--- a/lxd/images.go
+++ b/lxd/images.go
@@ -100,6 +100,8 @@ func unpack(file string, path string) error {
command = "unsquashfs"
args = append(args, "-f", "-d", path, "-n")
+ // Limit unsquashfs chunk size to 10% of memory and up to 256MB (default)
+ // When running on a low memory system, also disable multi-processing
mem, err := deviceTotalMemory()
mem = mem / 1024 / 1024 / 10
if err == nil && mem < 256 {
More information about the lxc-devel
mailing list