Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Oct 2023 17:57:48 +0900
From:      Tatsuki Makino <tatsuki_makino@hotmail.com>
To:        ports@freebsd.org
Subject:   Re: We need to do something about build times
Message-ID:  <SI2PR01MB50364C673D217F06B3E8E711FAA0A@SI2PR01MB5036.apcprd01.prod.exchangelabs.com>
In-Reply-To: <ZTgXDSmpAq6lpT3f@fuz.su>
References:  <ZTgXDSmpAq6lpT3f@fuz.su>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello.

Robert Clausecker wrote on 2023/10/25 04:12:
> And it seems I'm slowly killing my build SSD like that.  After just about
> 9 months, it is already at 100 TB of writes just from port builds.
> Building with workdirs in memory is no longer an option as that frequently
> kills my build server by filling all its RAM with build files until no
> processes can be started anymore.  Poudriere does not have an effective
> mechanism to prevent this (tmpfs limits don't work as the ports in
> question require very large workdirs, tend to take very long to build and
> tend to be built all at the same time for multiple jails).

Modern compression algorithms are so efficient that some distfiles inject source code into WRKDIR like mentos cola. FreeBSD is not MentOS.
If wrkdir is placed in tmpfs by USE_TMPFS, that alone will cause excessive memory usage.

I don't know how effective this would be, but I have thought of the following setup.
The goal is not to reduce the amount of reading and writing, but to change the speed of reading and writing.
Right now I am trying this on poudriere-3.3.7_4.

Changes for /usr/local/etc/poudriere.conf
Set USE_TMPFS to the following settings

USE_TMPFS="data localbase"

Changes for /usr/local/etc/poudriere.d/make.conf
The following block will be added so that the stage can also be placed in tmpfs.

.if 1
STAGEDIRPREFIX=	${LOCALBASE}/.stage
STAGEDIR=	${STAGEDIRPREFIX}${.CURDIR}/${_WRKDIR}/stage
_PORTS_DIRECTORIES+=	${STAGEDIRPREFIX}
_USES_fetch+=	980:..stagedirprefix
${STAGEDIRPREFIX}/😈: ${STAGEDIRPREFIX}
	@${CHMOD} -R 1777 ${STAGEDIRPREFIX}
	@${TOUCH} ${TOUCH_FLAGS} ${.TARGET:Q}
..stagedirprefix: ${STAGEDIRPREFIX}/😈
.endif

It is a bit tricky to make it so that even nobody can write on it :)
I don't know how well this is working as I am now having chromium made on the same machine as poudriere :)
As far as df -h -t tmpfs is concerned, it does not seem to be allocating a lot of memory to tmpfs.

Regards.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?SI2PR01MB50364C673D217F06B3E8E711FAA0A>