BiglyBT: Turn off the heating and save energy.

All other I2P Bittorrent related talk
User avatar
lgillis
Posts: 138
Joined: Mon May 09, 2022 8:40 am

BiglyBT: Turn off the heating and save energy.

Post by lgillis »

The BitTorrent client BiglyBT (BBt) permanently produces temperatures at least 10°C higher than necessary. Measured here, it depends on the hardware. The result is that the hardware wears out faster due to higher temperatures, the batteries discharge faster and the costs increase. The following shell script limits the CPU usage by BBt to a tolerable 20 percent. Data transmission doesn't suffer, it's the built-in bells and whistles that we all love so much that are throttled a bit with this. Simply call it after BBt has been started and forget it, it terminates itself when BBt is terminated.

Code: Select all

#!/bin/sh

### cpulimit für BiglyBT
#   Tools: pgrep (procps), cpulimit

test $# -gt 0 &&
	{
		# Non-interactive script that starts cpulimit for a running Java (BiglyBT).
		printf "Nicht interaktives Skript, welches cpulimit für ein laufendes Java (BiglyBT) startet.\n"
		exit
	}

# PID muss existieren / must exist
PID=$(pgrep -a java | grep BiglyBT.jar | cut -d' ' -f1)

case "$PID" in
	[0-9]*)
		cpulimit -b -q --pid "$PID" --limit 20 --lazy
		# cpulimit (20 percent) started for BiglyBT with PID %s.
		printf "cpulimit (20 Prozent) für BiglyBT mit PID %s gestartet.\n" "$PID"
		;;
	'')
		# No PID found for BiglyBT, has BiglyBT been started?
		printf "Keine PID für BiglyBT gefunden, wurde BiglyBT gestartet?\n"
		;;
esac