How to limit cpu usage when yay builds packages?

I like trying (allegedly) lighter apps, so I’ve been trying to install some with yay. One of them is the Sayonara music player, so I can compare it with Audacious. However, when I run the yay sayonara command, it never gets to completion because the system shuts down due to temperatures being too high. I’ve already got the goods in place to turn off the Nvidia GPU (which continues to heat up even when not “in use”), and I selected the “powersave” cpu governor. I’m also using Openbox, not a DE (I had been using Budgie, and it alone kept the CPU temps too high).

I’m new to EndeavourOS, new to using yay and such, and could not find anything helpful in the yay command “help”. Any suggestions?

Ensure that /etc/makepkg.conf has

MAKEFLAGS="-j1"

Or you can put the same in ~/.config/pacman/makepkg.conf.

That wont keep all the things down, but it will mean that only a single cpu core is used for compilation.

Thanks, @cscs ! I peeked in /etc/makepkg.conf, and saw what I assumed was the default (commented out via #) as '“-j2” . Does this really mean that it was only using two cores all this time yet STILL taking my system down via overheating? Wow.

What is the hardware?

inxi -Faz

Well, sheet. Just shut down again, despite the “-j1” setting.

System:
Kernel: 6.16.4-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 15.2.1
clocksource: tsc avail: hpet,acpi_pm
parameters: BOOT_IMAGE=/boot/vmlinuz-linux
root=UUID=365944ed-aa14-43c3-8cda-3fa39ea6e94e rw nowatchdog
nvme_load=YES loglevel=3
Desktop: Openbox v: 3.6.1 with: tint2 tools: avail: budgie-screensaver,
i3lock, xss-lock vt: 7 dm: LightDM v: 1.32.0 Distro: EndeavourOS
base: Arch Linux
Machine:
Type: Laptop System: SAMSUNG product: RF511/RF411/RF711 v: 10HX
serial: Chassis: type: 9 serial:
Mobo: SAMSUNG model: RF511/RF411/RF711 v: 10HX
serial: uuid:
BIOS: American Megatrends v: 10HX.M034.20110426.SSH date: 04/26/2011
Battery:
ID-1: BAT1 charge: 35.5 Wh (80%) condition: 44.4/48.8 Wh (90.9%)
volts: 10.74 min: 11.1 model: SAMSUNG Electronics type: Li-ion serial: N/A
charging: status: not charging cycles: N/A
Device-1: hidpp_battery_0 model: Logitech ERGO M575 Trackball
serial: charge: 55% rechargeable: yes status: discharging
CPU:
Info: model: Intel Core i7-2630QM bits: 64 type: MT MCP arch: Sandy Bridge
gen: core 2 level: v2 built: 2010-12 process: Intel 32nm family: 6
model-id: 0x2A (42) stepping: 7 microcode: 0x2F
Topology: cpus: 1x dies: 1 clusters: 4 cores: 4 threads: 8 tpc: 2
smt: enabled cache: L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB
desc: 4x256 KiB L3: 6 MiB desc: 1x6 MiB
Speed (MHz): avg: 800 min/max: 800/2900 scaling: driver: intel_cpufreq
governor: schedutil cores: 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800
8: 800 bogomips: 31927
Flags-basic: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities:
Type: gather_data_sampling status: Not affected
Type: ghostwrite status: Not affected
Type: indirect_target_selection status: Not affected
Type: itlb_multihit status: KVM: Split huge pages
Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT
vulnerable
Type: mds mitigation: Clear CPU buffers; SMT vulnerable
Type: meltdown mitigation: PTI
Type: mmio_stale_data status: Not affected
Type: old_microcode status: Not affected
Type: reg_file_data_sampling status: Not affected
Type: retbleed status: Not affected
Type: spec_rstack_overflow status: Not affected
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
prctl
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
sanitization
Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; IBRS_FW;
STIBP: conditional; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not
affected
Type: srbds status: Not affected
Type: tsa status: Not affected
Type: tsx_async_abort status: Not affected
Graphics:
Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics
vendor: Samsung Co driver: i915 v: kernel arch: Gen-6 code: Sandybridge
process: Intel 32nm built: 2011 ports: active: LVDS-1,VGA-1
empty: DP-1,HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:0116 class-ID: 0300
Device-2: Silicon Motion WebCam SCB-1100N driver: uvcvideo type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-1.1:3
chip-ID: 2232:1008 class-ID: 0e02
Display: x11 server: X.Org v: 21.1.18 with: Xwayland v: 24.1.8 driver: X:
loaded: modesetting alternate: fbdev,intel,vesa dri: crocus gpu: i915
display-ID: :0 screens: 1
Screen-1: 0 s-res: 1600x2820 s-dpi: 96 s-size: 422x744mm (16.61x29.29")
s-diag: 855mm (33.68")
Monitor-1: LVDS-1 pos: primary,bottom model: ChiMei InnoLux 0x1733
built: 2012 res: mode: 1600x900 hz: 60 scale: 100% (1) dpi: 106 gamma: 1.2
size: 382x215mm (15.04x8.46") diag: 448mm (17.6") ratio: 16:9
modes: 1600x900
Monitor-2: VGA-1 pos: top model: Dell P2214H serial: built: 2015
res: mode: 1920x1080 hz: 60 scale: 177% (0.5625) to: 1080x1920 dpi: 102
gamma: 1.2 size: 477x268mm (18.78x10.55") diag: 547mm (21.5") ratio: 16:9
modes: max: 1920x1080 min: 720x400
API: EGL v: 1.5 hw: drv: intel crocus platforms: device: 0 drv: crocus
device: 1 drv: swrast gbm: drv: crocus surfaceless: drv: crocus x11:
drv: crocus inactive: wayland
API: OpenGL v: 4.5 compat-v: 3.3 vendor: intel mesa v: 25.2.1-arch1.5
glx-v: 1.4 direct-render: yes renderer: Mesa Intel HD Graphics 3000 (SNB
GT2) device-ID: 8086:0116 memory: 1.46 GiB unified: yes
Info: Tools: api: eglinfo,glxinfo de: kscreen-doctor
x11: xdpyinfo, xprop, xrandr
Audio:
Device-1: Intel 6 Series/C200 Series Family High Definition Audio
vendor: Samsung Co driver: snd_hda_intel v: kernel bus-ID: 00:1b.0
chip-ID: 8086:1c20 class-ID: 0403
Device-2: Intel USB2.0 Device driver: hid-generic,snd-usb-audio,usbhid
type: USB rev: 1.1 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-1:2
chip-ID: 8087:1024 class-ID: 0300 serial:
Device-3: AKAI MPKmini2 driver: hid-generic,snd-usb-audio,usbhid type: USB
rev: 1.1 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-2.2:5
chip-ID: 2011:0715 class-ID: 0103 serial:
API: ALSA v: k6.16.4-arch1-1 status: kernel-api
tools: alsactl,alsamixer,amixer
Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
Server-2: PipeWire v: 1.4.7 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Broadcom BCM4313 802.11bgn Wireless Network Adapter vendor: Askey
driver: wl v: kernel modules: bcma pcie: gen: 1 speed: 2.5 GT/s lanes: 1
bus-ID: 02:00.0 chip-ID: 14e4:4727 class-ID: 0280
IF: wlan0 state: up mac:
Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
vendor: Samsung Co driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
lanes: 1 port: b000 bus-ID: 03:00.0 chip-ID: 10ec:8168 class-ID: 0200
IF: enp3s0 state: down mac:
Info: services: NetworkManager, systemd-timesyncd, wpa_supplicant
Bluetooth:
Device-1: Broadcom BCM2070 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 4-1.3:3 chip-ID: 0a5c:219c
class-ID: fe01 serial:
Report: btmgmt ID: hci0 rfk-id: 3 state: down bt-service: disabled
rfk-block: hardware: no software: no address: N/A
Drives:
Local Storage: total: 2.96 TiB used: 373.56 GiB (12.3%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 1TB
size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: fw-rev: 2B6Q scheme: MBR
ID-2: /dev/sdb maj-min: 8:16 vendor: SK Hynix model: SC311 SATA 256GB
size: 238.47 GiB block-size: physical: 4096 B logical: 512 B type: USB
rev: 2.1 spd: 480 Mb/s lanes: 1 mode: 2.0 tech: SSD serial:
fw-rev: 0204 scheme: GPT
ID-3: /dev/sdc maj-min: 8:32 vendor: Seagate model: BUP Slim BK
size: 1.82 TiB block-size: physical: 4096 B logical: 512 B type: USB
rev: 2.1 spd: 480 Mb/s lanes: 1 mode: 2.0 tech: N/A serial:
fw-rev: 0109 scheme: GPT
Partition:
ID-1: / raw-size: 125.97 GiB size: 123.44 GiB (97.99%)
used: 14.36 GiB (11.6%) fs: ext4 dev: /dev/sdb5 maj-min: 8:21
Swap:
Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: yes
compressor: zstd max-pool: 20%
ID-1: swap-1 type: partition size: 12 GiB used: 0 KiB (0.0%) priority: -2
dev: /dev/sdb4 maj-min: 8:20
Sensors:
System Temperatures: cpu: 70.0 C mobo: N/A
Fan Speeds (rpm): N/A
Info:
Memory: total: 8 GiB available: 7.66 GiB used: 699.3 MiB (8.9%)
Processes: 210 Power: uptime: 1m states: freeze,standby,mem,disk
suspend: deep avail: s2idle,shallow wakeups: 0 hibernate: platform
avail: shutdown, reboot, suspend, test_resume image: 3.05 GiB
services: power-profiles-daemon Init: systemd v: 257 default: graphical
tool: systemctl
Packages: pm: pacman pkgs: 1289 libs: 314 tools: yay pm: flatpak pkgs: 0
Compilers: gcc: 15.2.1 Shell: Bash v: 5.3.3 running-in: lxterminal
inxi: 3.3.39

You should really investigate why your system is overheating. Maybe time for a better cooler, or a re-paste.

That said, since you’re using the power-profiles-daemon, you could try setting your system to power-saver mode, which will usually set the CPU governor to lower CPU frequency and disable turbo mode. That could help keeping the temp down.

First, list possible modes and note which you’re using (denoted by a *):

$ powerprofilesctl list
* performance:
    CpuDriver:	intel_pstate
    PlatformDriver:	platform_profile
    Degraded:   no

  balanced:
    CpuDriver:	intel_pstate
    PlatformDriver:	platform_profile

  power-saver:
    CpuDriver:	intel_pstate
    PlatformDriver:	platform_profile

So we are in performance mode. Let’s switch to power-saver:

$ powerprofilesctl set power-saver

and verify:

$ powerprofilesctl get
power-saver

Now try your updates and compilations.

You can watch your temperatures in a second terminal, using for instance:

$ watch -n 15 inxi -s

This will interrogate and show your system temperature sensors every 15 seconds.

EDIT: Oops. Sorry, just realized you said you already use power-saver mode… :blush:

Yeah, thanks for reading the first page! :grinning_face: This is an early teens Samsung RF711 with Optimus graphics – Intel + Nvidia GE540 or something (that has to be turned OFF to help prevent overheating). Fan speed cannot be controlled. I opened the box up a month ago and replaced the thermal paste. I always make a system so I can see what the current CPU temp is – right now, using a customized Conky (is there a non-customized Conky???), previously was using Budgie, which doesn’t have a widget or suchlike to monitor system temps. I typically ditch most any DE in favor of lightweight WM’s like Openbox, Fluxbox, JWM (my Openbox setup with tint2 and Conky comes up at ~230 MB whereas Budgie was ~660+ MB). Fewer active programs to cycle through most of the time makes for a less hot environment. So I sorta know my way around temperature control stuff. :wink:

Right now, I’m wondering if I made a mistake by NOT installing tlp after finding that it conflicted with the Budgie (or EOS) power manager. I use tlp everywhere else, so might have to try disabling the power manager and installing tlp.

Not sure if any of that will help with the yay builds, tho’….

In any case, thanks for chiming in!!! Much appreciated!

PPD gives less control than TLP.

You can replace it if you want.

@cscs, you got that right! I did just that, installed and ran tlp and tlp-ui and set some pretty limiting caps for CPU usage.

Ran yay sayonara and while it took an inordinate amount of time, it never got over 83C (actually, that might have been prior to the builds) and completed satisfactorily. I’m sure having the MAKEFLAGS=”-j1” helped as well.

Now I know better to not trust my instincts (the bit about not installing tlp in favor of PPD).

And after all that, after trying out Sayonara, it’s no better (and waaay bigger) than Audacious. Now it’s going back to the bit-bin….

Thanks everyone!

Fair enough.

I also find PPD too limiting and still use TLP along with some custom tweaks and scripting.

By the way for music players .. you might also check cmus - terminal player.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.