From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mail.openembedded.org (Postfix) with ESMTP id 7F4B876004 for ; Fri, 11 May 2018 15:35:15 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 May 2018 08:35:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,389,1520924400"; d="scan'208";a="54374222" Received: from kanavin-desktop.fi.intel.com (HELO [10.237.68.161]) ([10.237.68.161]) by fmsmga001.fm.intel.com with ESMTP; 11 May 2018 08:35:15 -0700 To: Peter Kjellerstedt , "openembedded-core@lists.openembedded.org" References: From: Alexander Kanavin Message-ID: Date: Fri, 11 May 2018 18:27:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Subject: Re: [PATCH 2/2] rpm: Assume a max limit of 1024 open files X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 May 2018 15:35:15 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 05/11/2018 01:39 PM, Peter Kjellerstedt wrote: > However, I gave this some more thought, and maybe it would be better to > let bitbake set the soft limit for max open files to, e.g., 1024. That > way we would not need to modify the code in rpm as it would adapt itself > automatically. I tried adding the following to bitbake_main and it worked: > > import resource > > # Set the maximum number of open files as there are performance problems > # with, e.g., rpm if this is unlimited (which it may be if running inside > # a Docker container). > (soft, hard) = resource.getrlimit(resource.RLIMIT_NOFILE) > soft = int(os.environ.get("BB_LIMIT_NOFILE", "1024")) > resource.setrlimit(resource.RLIMIT_NOFILE, (min(soft, hard), hard)) That's right, this is the best solution. Alex