From: Vitaly Lipatov <lav@altlinux.ru>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: [devel] Ограничение количества сборочных процессов под размер доступной памяти
Date: Thu, 19 Jul 2018 08:55:33 +0300
Message-ID: <0c9ed8c68aed5a5f5e9e48abc5df3af2@altlinux.ru> (raw)
Поскольку на сборочных машинах теперь заданиям теперь выдаётся большое
количество процессов, программы на C++ с множеством модулей,
собирающихся параллельно, могут не влезть в память при компиляции.
Если написать в спеке
BuildRequires(pre): rpm-build-intro >= 2.1.6
%_tune_parallel_build_by_procsize 1500
то количество используемых при параллельной сборке процессов будет
ограничено с учётом заявленного потребления 1500Мб на процесс, примерно
по такой формуле:
__nprocs = max(min(round(MAX/NEED)-1,__nprocs),1)
где MAX и NEED — это объём доступной в системе и требуемой процессом
памяти соответственно.
Это решение с успехом применил при сборке telegram-desktop, см.
https://bugzilla.altlinux.org/show_bug.cgi?id=35112#c2
--
С уважением,
Виталий Липатов,
Etersoft
next reply other threads:[~2018-07-19 5:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 5:55 Vitaly Lipatov [this message]
2018-07-19 9:26 ` Dmitry V. Levin
2018-07-19 10:18 ` Vitaly Lipatov
2018-07-19 11:17 ` Dmitry V. Levin
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=0c9ed8c68aed5a5f5e9e48abc5df3af2@altlinux.ru \
--to=lav@altlinux.ru \
--cc=devel@lists.altlinux.org \
/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
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git