Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Alexander Kanavin <alexander.kanavin@linux.intel.com>
To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 2/2] rpm: Assume a max limit of 1024 open files
Date: Fri, 11 May 2018 18:27:42 +0300	[thread overview]
Message-ID: <e87faf98-0173-b2f6-cb5c-8352fb435026@linux.intel.com> (raw)
In-Reply-To: <ad98467799e844e8a8055ab4d2808ba4@XBOX02.axis.com>

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


      reply	other threads:[~2018-05-11 15:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 22:20 [PATCH 0/2] Restore performance of rpm in Docker containers Peter Kjellerstedt
2018-05-10 22:20 ` [PATCH 1/2] Revert "rpm: add a patch to help with Docker performance issues" Peter Kjellerstedt
2018-05-10 22:20 ` [PATCH 2/2] rpm: Assume a max limit of 1024 open files Peter Kjellerstedt
2018-05-11  5:43   ` Alexander Kanavin
2018-05-11 10:39     ` Peter Kjellerstedt
2018-05-11 15:27       ` Alexander Kanavin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e87faf98-0173-b2f6-cb5c-8352fb435026@linux.intel.com \
    --to=alexander.kanavin@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=peter.kjellerstedt@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox