Limit CPU usage when building ports?

I'm updating Libreoffice, Firefox, and Thunderbird right now and it takes a LONG time to compile all of them. Unfortunately, when they are building, my system becomes somewhat unresponsive.

Is it possible to limit CPU usage when building a port?
 
You're not building them all at the same time, are you?

If you're using a terminal with antialiasing, try running the build in a disconnected sysutils/tmux session. Antialiasing all that scrolling text can really slow down interactive response.
 
After updating my ports tree, those were the only three that were out of date, so I just opened up a new terminal window (urxvt) and typed
Code:
portupgrade -a
 
Prefix command with [cmd=]nice -n 20[/cmd] and get it off your screen as much as possible, as wblock said.
 
Unresponsive? My guess, it's either write bursts or memory thrashing during linking. So, try using IO scheduler (zio or gsched) to force system write often but in small amounts or tune VM to not swap out interactive apps.
 
You can generally check how many dependencies there are for a port, then build smaller ones concurrently, or large ones sequentially. Then, no worries about running out of time, one can have, say, thunderbird building in an xterm,
Code:
 killall -HUP Xorg
to exit X, and either restart the build where it left off the next time one is in an xterm, or finish it at the console thusly
Code:
 cd /usr/ports/mail/thunderbird && make build
(using some of the port upgrade tools will start the build anew though.) sysutils/ttyload can notify you visually when
CPU usage is down enough to start other ports concurrently... possibly. (Assumes the browser you may be using during the builds does not itself use
a lot of CPU. )
 
Back
Top