mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-09 20:32:52 +02:00
every rtorrent process cpulimit
This commit is contained in:
@@ -162,14 +162,26 @@ if [ "$1" == "backup-torrent-hosting" ]; then
|
|||||||
sudo sed -i "s/^backupTorrentSeeding=.*/backupTorrentSeeding=on/g" /mnt/hdd/raspiblitz.conf
|
sudo sed -i "s/^backupTorrentSeeding=.*/backupTorrentSeeding=on/g" /mnt/hdd/raspiblitz.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set the torrents processes to cpulimit 20%
|
# set the torrents processes to cpulimit 25%
|
||||||
sessionPID=$(screen -ls | grep "blockchain" | cut -d "." -f1 | xargs)
|
|
||||||
echo "Putting rTorrent blockchain 'BASE' (PID=${sessionPID}) to background ... (please wait)"
|
|
||||||
sudo cpulimit -p ${sessionPID} -l 25 &
|
|
||||||
sessionPID=$(screen -ls | grep "update" | cut -d "." -f1 | xargs)
|
|
||||||
echo "Putting rTorrent blockchain 'UPDATE' (PID=${sessionPID}) to background ... (please wait)"
|
|
||||||
sudo cpulimit -p ${sessionPID} -l 25 &
|
|
||||||
sleep 6
|
sleep 6
|
||||||
|
echo ""
|
||||||
|
rtorrentPIDs=$(ps axf | grep "rtorrent" | awk '{$1=$1;print}' | cut -d' ' -f1)
|
||||||
|
while read -r pid ; do
|
||||||
|
ps ${pid} | grep "rtorrent"
|
||||||
|
echo "---> reducing this rTorrent process to 25% CPU"
|
||||||
|
sudo cpulimit -p ${pid} -l 25 &
|
||||||
|
echo ""
|
||||||
|
done < <(echo "${rtorrentPIDs}")
|
||||||
|
sleep 6
|
||||||
|
|
||||||
|
# set the torrents processes to cpulimit 20%
|
||||||
|
#sessionPID=$(screen -ls | grep "blockchain" | cut -d "." -f1 | xargs)
|
||||||
|
#echo "Putting rTorrent blockchain 'BASE' (PID=${sessionPID}) to background ... (please wait)"
|
||||||
|
#sudo cpulimit -p ${sessionPID} -l 25 &
|
||||||
|
#sessionPID=$(screen -ls | grep "update" | cut -d "." -f1 | xargs)
|
||||||
|
#echo "Putting rTorrent blockchain 'UPDATE' (PID=${sessionPID}) to background ... (please wait)"
|
||||||
|
#sudo cpulimit -p ${sessionPID} -l 25 &
|
||||||
|
|
||||||
echo "Done BACKUP TORRENT HOSTING"
|
echo "Done BACKUP TORRENT HOSTING"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user