View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 23 posts ] 
Go to page Previous  1, 2

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject:
PostPosted: Sat Jul 07, 2007 9:45 am 
Offline
Joined: Thu Oct 19, 2006 11:21 am
Posts: 51
I tried the crontab but didn't like the log files filling up, and if it runs every second it seems one might as well launch it and have it running all the time, so I thought the following would be simpler:
1. modify ~mythtv/.fluxbox/apps to include the line:
Code:
[startup] {/home/mythtv/mythrenice.sh}

2. Make a script, the above should startup the following script, called mythrenice.sh:
Code:
#! /bin/sh
while [ 0==0 ] ; do
   x=`pidof mythcommflag` ;
   if [ $? == 0 ]; then
      renice 19 $x;
   fi
   sleep 1
done


This way everytime the mythtv user logs in ( and just try to log him out!) mythrenice.sh looks for the mythcommflag job and renices its priority to 19. As all the programs are spawned from the mythtv user account, it seems that control of them should be from the mythtv user as well.
mythtranscode also is a hog, as is mytharchive....but with the K.I.S.S. principle, this should fix 99% of the problem, until we all get dual cores.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 5:14 pm 
Offline
Joined: Thu Nov 10, 2005 1:33 pm
Posts: 5
Location: Maryland
If you'd like the command to run every 3 minutes, use this modified command:
Code:
*/3 * * * * root renice 19 $(pidof mythcommflag)


The */number construct works for the other fields, too, so you could have something run every 4 hours with
Code:
* */4 * * * command

Just one of those syntax oddities you find, then wonder how you could have lived without them. :idea:


Top
 Profile  
 
PostPosted: Thu Sep 27, 2007 7:02 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
posted January 2007...
cesman wrote:
Nice. Added to next release.
Did the babysitter make it into any releases since January 2007?

I've got a couple of clarification questions:

1. Which crontab does this belong in? The root user crontab (with no user called out) or the system crontab (the file "/etc/crontab" with the root user called out)?

2. How can I tell if this is working? I ask because I downloaded the script, ran the script and altered the root crontab after a commercial flagging process had already started and another program was currently recording. The flagging process held 50% of the processor time continously until it finished. It didn't look like it was downgraded in priority at all.

Eric

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
PostPosted: Fri Sep 28, 2007 5:48 am 
Offline
Joined: Fri Nov 18, 2005 9:22 am
Posts: 777
Location: spencerport, ny (USA)
neutron68 wrote:
1. Which crontab does this belong in? The root user crontab (with no user called out) or the system crontab (the file "/etc/crontab" with the root user called out)?

I run it as root. i.e. as root, I edit the crontab and put this in.


Quote:
2. How can I tell if this is working?


Use "top" to view the processes. The priority of commflag should go from 17 to 19, when the babysitter sees it. 19 is lowest priority.
It'll still use lots of CPU if nothing else is running....


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 13, 2007 8:37 pm 
Offline
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location: Brisbane, Australia
Hi All,

This type of thing works really well. I renice a few more programms like mythtranscode etc, and I don't really notice any slow down at all (P4 2GHz). This script looks for a set list of programs to renice, and then renices to 19 if it isn't already so.

Code:
#!/bin/bash

LIST=( mencoder ffmpeg mythtranscode mythcommflag vamps mythfilldatabase )

ps -Al|while read PROCESS; do
   PRIORITY=`echo $PROCESS | awk '{ print $8 }'`
   NAME=`echo $PROCESS | awk '{ print $14 }'`
   PID=`echo $PROCESS | awk '{ print $4 }'`

   listnum=${#LIST}
   for ((i=0;i<$listnum;i++));do
      if [ "$NAME" = "${LIST[${i}]}" ]; then
         if [ "$PRIORITY" -lt "19" ]; then
            renice 19 -p $PID
         fi
         break
      fi
   done
done


Enjoy.
BigB.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 12:42 am 
Offline
Joined: Thu Feb 23, 2006 2:41 pm
Posts: 68
Not that it matters, but my system's commflag has started being less nice for the last couple days in a row now right around ten pm. Right around the time when my wife is watching tv. It drops to 17, when I renice it to 19 it seems to take a while to give up the cpu. Anyway, I'll be working on en-stating this script if I can't pin down what is triggering the change. Wasn't sure if others had noticed a specific time that associated with the problem.

arri

_________________
Athlon 64 X2 4200+ 2GB Ram
MSI K8N Neo4-F NF4 939
ASUS N EN6200TC256/TD/64M
500gb SATA
1x Plextor PX-M402U
1x HD5000
R5.5 Upgrade from F27


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 8:18 pm 
Offline
Joined: Sat Feb 03, 2007 12:52 am
Posts: 187
Location: Manitoba, Canada
I found this thread http://mysettopbox.tv/phpBB2/viewtopic.php?t=16990 and gave it a try. now I can record, watch, and commflag at the same time. my system isn't that big AMD 1800 512RAM


Top
 Profile  
 
PostPosted: Wed Nov 26, 2008 11:03 pm 
Offline
Joined: Wed Jul 19, 2006 12:36 pm
Posts: 24
bigB wrote:
This script looks for a set list of programs to renice, and then renices to 19 if it isn't already so.


FYI, Nathan (nmcaullay) made some updates to the script and I just posted some more improvements to the other thread.

Enjoy,
Chael


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ] 
Go to page Previous  1, 2



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu