[mythtv-users] 0.25 SQL CPU Load issues after optimisation

Another Sillyname anothersname at googlemail.com
Thu Jul 19 19:26:30 UTC 2012


On 19 July 2012 19:55, Another Sillyname <anothersname at googlemail.com> wrote:
> On 19 July 2012 12:32, David Fishburn <dfishburn.mythtv at gmail.com> wrote:
>> What commands did you use to generate these query lists?
>>
>> Thanks.
>> --
>> David Fishburn
>>
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://www.mythtv.org/mailman/listinfo/mythtv-users
>
> I wrote my own bash script David, I'll E-Mail a copy to you OFFLIST

Actually as the script is so small I'll just publish it on the E-Mail
List for anyone who would like to check their Server.

Please remember to put the password for your admin user at the point marked XXX.

The script waits for the SQL load to get over 75% then starts to dump
a file called sqlload'timestamp' to your Desktop, it stops when the
load falls back below 75%.

If a few users could run it for testing it would be useful, it ONLY
starts to dump when load is > 75%

#!/bin/sh

FILENOW=`date +%a"."%b%d"."%H":"%M":"%S`
COUNT="0"
cd ~/Desktop
LOADOUTPUT="sqlload@""$FILENOW"
touch "$LOADOUTPUT"

SQLLOAD="0"

while [ "$SQLLOAD" -le 75 ] ; do

SQLLOAD=`top -b -n 1 | grep mysqld | awk -F " " '{ print $9 }'`

done;

while [ "$SQLLOAD" -ge 75 ]; do

mysql -uroot -pXXXADDYOURPASSWORDHEREXXX -e"SHOW full processlist;" >>
"$LOADOUTPUT"

NEWNOW=`date +%a"."%b%d"."%H":"%M":"%S`

echo -e "**************\n\n\n$NEWNOW\n\n\n Next Pass" >> "$LOADOUTPUT"

COUNT=`echo "$COUNT + 1" | bc`

echo "Count $COUNT  sqlload $SQLLOAD"

sleep 1

SQLLOAD=`top -b -n 1 | grep mysqld | awk -F " " '{ print $9 }'`

done

echo "Glitch finished at $NEWNOW, end of Run" >> "$LOADOUTPUT"


More information about the mythtv-users mailing list