opnsense build using not using all cpu cores

Started by none, July 24, 2026, 01:47:48 PM

Previous topic - Next topic
Hi,

I build arm64 images for opnsense and this week I begun building for 26.7 family. Usually ports build takes 20 to 24 hours, but it is now over 3 days and not close to end.

Has the change to FreeBSD 15.1 demanded special config to use all cpu cores? FreeBSD can see all 8 cores:

---<<BOOT>>---
Copyright (c) 1992-2025 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 15.1-RELEASE releng/15.1-n283562-96841ea08dcf GENERIC arm64
FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)
VT(efifb): resolution 640x480
real memory  = 16879779840 (16097 MB)
avail memory = 16487489536 (15723 MB)
Starting CPU 1 (100)
Starting CPU 2 (200)
Starting CPU 3 (300)
Starting CPU 4 (400)
Starting CPU 5 (500)
Starting CPU 6 (600)
Starting CPU 7 (700)
FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs

but the ports build uses only one :(

If anyone have any hints on how to change it :)

thanks,

none
"We will call you Cygnus,
the God of balance you shall be."

The ports build one by one. Some ports use multiple CPUs, some don't. Not looking into changing this.

Poudriere exists if you want to use it, but it's overloaded for our use case.


Cheers,
Franco

Thanks for the answer.

My usual build time for it all was about 36h. Now its way more, and the box is the same. I am looking for the reason :)

none
"We will call you Cygnus,
the God of balance you shall be."

I found 15.x to be somewhat slower on IO in general. Noticed while installing images mostly. I'm not sure what to do about that.


Cheers,
Franco

Hi Franco,

would be a big issue if I build 26.7 using 14.x FreeBSD?

On 26.1 I used to build and it was ok, faster and the build would run without errors. For 26.7 the packages get errors and even github clone fails with timeout. My guess is something about 15.1 and arm boxes, as other amd64 15.1 systems don't show this, and they are on the very same network, ISP, dns server, etc...

I remember using command line to overrule OS version. But my question is if that would hurt the final image binaries.

the errors are:

>>> ERROR: The build encountered fatal issues!
>>> Aborted netdata-2.8.5_7 via net-mgmt/netdata
>>> Aborted telegraf-1.39.1_1 via net-mgmt/telegraf
>>> Aborted opnsense-filterlog-0.10.0 via opnsense/filterlog-go
>>> Aborted ndp-proxy-go-1.0.4 via opnsense/ndp-proxy-go
>>> Aborted crowdsec-1.7.8_1 via security/crowdsec
>>> Aborted tailscale-1.98.9 via security/tailscale
>>> Aborted xray-core-26.3.27_2 via security/xray-core
>>> Aborted node_exporter-1.11.0_3 via sysutils/node_exporter
>>> Aborted nut-2.8.5_1 via sysutils/nut
>>> Aborted caddy-custom-2.11.4.0.0.4.5.13_18 via www/caddy-custom
*** Error code 1

have this also:

pkg-static: Both ABI_FILE and OSVERSION are set, ABI_FILE overrides OSVERSION
# get https://proxy.golang.org/github.com/akavel/rsrc/@v/v0.10.2.mod: Get "https://proxy.golang.org/github.com/akavel/rsrc/@v/v0.10.2.mod": net/http: TLS handshake timeo
ut
# get https://proxy.golang.org/github.com/spf13/cobra/@v/v1.9.1.mod: Get "https://proxy.golang.org/github.com/spf13/cobra/@v/v1.9.1.mod": net/http: TLS handshake timeout
# get https://proxy.golang.org/github.com/inconshreveable/mousetrap/@v/v1.1.0.mod: Get "https://proxy.golang.org/github.com/inconshreveable/mousetrap/@v/v1.1.0.mod": net
/http: TLS handshake timeout
# get https://proxy.golang.org/github.com/spf13/pflag/@v/v1.0.6.info
# get https://proxy.golang.org/github.com/google/shlex/@v/v0.0.0-20191202100458-e7afc7fbc510.info
# get https://proxy.golang.org/github.com/inconshreveable/mousetrap/@v/v1.1.0.info
# get https://proxy.golang.org/github.com/spf13/cobra/@v/v1.9.1.info
# get https://proxy.golang.org/github.com/akavel/rsrc/@v/v0.10.2.info
# get https://proxy.golang.org/github.com/%21masterminds/semver/v3/@v/v3.4.0.info
# get https://proxy.golang.org/github.com/josephspurrier/goversioninfo/@v/v1.5.0.info
# get https://proxy.golang.org/github.com/spf13/pflag/@v/v1.0.6.info: 200 OK (0.299s)
# get https://proxy.golang.org/github.com/google/shlex/@v/v0.0.0-20191202100458-e7afc7fbc510.info: 200 OK (0.299s)
# get https://proxy.golang.org/github.com/inconshreveable/mousetrap/@v/v1.1.0.info: 200 OK (0.300s)
# get https://proxy.golang.org/github.com/akavel/rsrc/@v/v0.10.2.info: 200 OK (0.300s)
# get https://proxy.golang.org/github.com/%21masterminds/semver/v3/@v/v3.4.0.info: 200 OK (0.301s)
# get https://proxy.golang.org/github.com/spf13/cobra/@v/v1.9.1.info: 200 OK (275.998s)
# get https://proxy.golang.org/github.com/josephspurrier/goversioninfo/@v/v1.5.0.info: 200 OK (275.998s)
go: github.com/Masterminds/semver/v3@v3.4.0: Get "https://proxy.golang.org/github.com/%21masterminds/semver/v3/@v/v3.4.0.mod": net/http: TLS handshake timeout
go: github.com/akavel/rsrc@v0.10.2: Get "https://proxy.golang.org/github.com/akavel/rsrc/@v/v0.10.2.mod": net/http: TLS handshake timeout
go: github.com/google/shlex@v0.0.0-20191202100458-e7afc7fbc510: Get "https://proxy.golang.org/github.com/google/shlex/@v/v0.0.0-20191202100458-e7afc7fbc510.mod": net/htt
p: TLS handshake timeout
go: github.com/inconshreveable/mousetrap@v1.1.0: Get "https://proxy.golang.org/github.com/inconshreveable/mousetrap/@v/v1.1.0.mod": net/http: TLS handshake timeout     
go: github.com/josephspurrier/goversioninfo@v1.5.0: Get "https://proxy.golang.org/github.com/josephspurrier/goversioninfo/@v/v1.5.0.mod": net/http: TLS handshake timeout
go: github.com/spf13/cobra@v1.9.1: Get "https://proxy.golang.org/github.com/spf13/cobra/@v/v1.9.1.mod": net/http: TLS handshake timeout
go: github.com/spf13/pflag@v1.0.6: Get "https://proxy.golang.org/github.com/spf13/pflag/@v/v1.0.6.mod": net/http: TLS handshake timeout
*** Error code 1

I will try to test over amd64 here to see if the errors are present too (network errors). I will try to fix a amd64 box over the weekend.

thanks for the help,

none
"We will call you Cygnus,
the God of balance you shall be."

Hi none,

Theoretically, you should be able to build 15.1 in 14.3 but in general it is recommended to build older versions on newer kernels, which brings your concern back on the table.  For official builds we cannot risk producing non-native packages so each versions must build in the matching FreeBSD version.

Historically, the cross-building stops at some point due to compiler issues which force you to upgrade the build host.  But that doesn't seem to be the case between 14.3 and 15.1 yet.


Cheers,
Franco