The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6309

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From c993b36cd3d682c2f55225c2c606e885d9d98769 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Sat, 12 Oct 2019 13:42:40 -0400
Subject: [PATCH] lxd/daemon: Bump NOFILE to max on startup
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/daemon.go | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/lxd/daemon.go b/lxd/daemon.go
index 7c7bba6573..552cf0cd61 100644
--- a/lxd/daemon.go
+++ b/lxd/daemon.go
@@ -570,6 +570,22 @@ func (d *Daemon) init() error {
                return err
        }
 
+       // Bump some kernel limits to avoid issues
+       for _, limit := range []int{unix.RLIMIT_NOFILE} {
+               rLimit := unix.Rlimit{}
+               err := unix.Getrlimit(limit, &rLimit)
+               if err != nil {
+                       return err
+               }
+
+               rLimit.Cur = rLimit.Max
+
+               err = unix.Setrlimit(limit, &rLimit)
+               if err != nil {
+                       return err
+               }
+       }
+
        // Look for kernel features
        logger.Infof("Kernel features:")
        d.os.NetnsGetifaddrs = CanUseNetnsGetifaddrs()
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to