I recently purchased an HDHomeRun , so now my 0.20.2 BE/FE combo (Athlon XP 2500+, FC7) is straining to handle the load of HD playback along with commflagging (and the brutal scheduler query I cannot seem to conquer). I have a newer FE machine (Athlon X2 4800, FC8) that has excess capacity, so I began investigating how to off-load some work to that machine. I considered moving mysql to that machine, but commercial flagging became an obvious choice since it is soooo CPU-intensive. That is when I discovered Mythjobqueue. :)<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>I've configured my machines to prevent commercial flagging on the BE/FE, and allow it on the FE. I have successfully tested this by manually starting the Mythjobqueue task on the FE machine. Now, I would like to have that task run automatically every time the FE machine comes up (or when the mythtv user logs in). How are you handling this? Does myth have the ability to auto-start this task? Or, can it be a service? Does it need to run as myth user, or can it run as root? <br>
<br>Advice appreciated...<br><br>Try setting up this script. It will watch the mythcommflag job and pause it when cpu utilization is too high. It's not mine but works great! More information here</blockquote><div> </div>
<div><a href="http://mysettopbox.tv/phpBB2/viewtopic.php?t=16027&highlight=pausecommflag">http://mysettopbox.tv/phpBB2/viewtopic.php?t=16027&highlight=pausecommflag</a> <br></div><div><br>#!/bin/bash<br># pause_commflag.sh v0.1<br>
# Utility to automatically pause & unpause mythcommflag if CPU usage is above a certain level<br># Free for any use.<br># Installation:<br># cp pause_commflag.sh /usr/local/bin<br># chmod +x /usr/local/bin/pause_commflag.sh<br>
# Usage: Add to crontab (crontab -e) with logging:<br># * * * * * /usr/local/bin/pause_commflag.sh >>/var/log/mythtv/pause_commflag.log 2>&1<br># Usage: Add to crontab (crontab -e) without logging:<br># * * * * * /usr/local/bin/pause_commflag.sh<br>
<br><br>NOWDATE=$(date)<br>#CPUTHRESHOLD=65<br>#CPUTHRESHOLD=55<br>#CPUTHRESHOLD=50<br>CPUTHRESHOLD=45<br>PROCCOMMFLAG=`pidof mythcommflag`<br>if [ -n "${PROCCOMMFLAG}" ]<br>then<br> echo "$NOWDATE COMMFLAG Process FOUND. Checking Frontend CPU usage."<br>
FRONTENDCPU=`top -b -n 1 -u mythtv | grep mythfrontend | cut -c 43-45`<br># echo "Frontend CPU%: $FRONTENDCPU"<br> if [ "$FRONTENDCPU" -ge "$CPUTHRESHOLD" ]<br> then<br>
echo "Frontend CPU usage ($FRONTENDCPU %) is greater than the threshold \<br>($CPUTHRESHOLD %). PAUSE Commflagging"<br> kill -s STOP $PROCCOMMFLAG<br> else<br> echo "Frontend CPU usage ($FRONTENDCPU %) is less than the threshold \<br>
($CPUTHRESHOLD %). CONTINUE Commflagging"<br> kill -s CONT $PROCCOMMFLAG<br> fi<br>#else<br># echo "No COMMFLAG Process Active"<br>fi <br></div></div>-- <br>Tim<br>