Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

Folding@home, having it start/stop between recordings/jobs??

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


bobbygill at rogers

Apr 21, 2009, 1:11 PM

Post #1 of 12 (1124 views)
Permalink
Folding@home, having it start/stop between recordings/jobs??

I have set up folding [at] hom to run on my backend, however I'm wondering how I
can have it so that f@h runs whenever the mythbackend is NOT recording?
Since the f@h takes up 100% CPU (I have a P4 3.4ghz EE) I'd love to
configure it so they run alternately. I know I can pop the
rc.d/foldingathome stop/start in my crontab for whenever, but I'd like to
take it that step further as indicated. Really appreciate any help, thanks a
bunch.

Thanks
Bob


yan at seiner

Apr 21, 2009, 1:15 PM

Post #2 of 12 (1086 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

On Tue, April 21, 2009 1:11 pm, Bobby Gill wrote:
> I have set up folding [at] hom to run on my backend, however I'm wondering how
> I
> can have it so that f@h runs whenever the mythbackend is NOT recording?
> Since the f@h takes up 100% CPU (I have a P4 3.4ghz EE) I'd love to
> configure it so they run alternately. I know I can pop the
> rc.d/foldingathome stop/start in my crontab for whenever, but I'd like to
> take it that step further as indicated. Really appreciate any help, thanks
> a
> bunch.

man nice
man renice

Basically set the priority to the lowest:

IIRC something like

renice 20 f@h

should do the trick. I do the same thing; I have a huge ffmpeg job that
runs for about 10 minutes, hammering the drives and the CPU. It caused
all sorts of problems with myth until I re-niced it to the lowest level
possible.

--Yan

--
Yan Seiner, PE

Support my bid for the 4J School Board
http://www.seiner.com

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


bobbygill at rogers

Apr 21, 2009, 1:28 PM

Post #3 of 12 (1083 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

>
>
> man nice
> man renice
>
> Basically set the priority to the lowest:
>
> IIRC something like
>
> renice 20 f@h
>
> should do the trick. I do the same thing; I have a huge ffmpeg job that
> runs for about 10 minutes, hammering the drives and the CPU. It caused
> all sorts of problems with myth until I re-niced it to the lowest level
> possible.
>
> --Yan
>

Thanks Yan. So for my intermediate self, what is that doing? I don't have
any man pages for nice/renice. I just googled and see that it is
rescheduling the process priority, but would that completely stop the f@h if
a recording starts, and then when the flagging is done after, f@h starts
again? Or is that as simple as it sounds: giving the mythbackend the top dog
priority when it starts recording/a job and sending f@h way down in cpu
usage?

Thanks a bunch
Bob


david.schmidt.in.dallas at gmail

Apr 21, 2009, 1:33 PM

Post #4 of 12 (1082 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

On Tue, Apr 21, 2009 at 3:28 PM, Bobby Gill <bobbygill [at] rogers> wrote:
>>
>> man nice
>> man renice
>>
>> Basically set the priority to the lowest:
>>
>> IIRC something like
>>
>> renice 20 f@h
>>
>> should do the trick.  I do the same thing; I have a huge ffmpeg job that
>> runs for about 10 minutes, hammering the drives and the CPU.  It caused
>> all sorts of problems with myth until I re-niced it to the lowest level
>> possible.
>>
>> --Yan
>
> Thanks Yan. So for my intermediate self, what is that doing? I don't have
> any man pages for nice/renice. I just googled and see that it is
> rescheduling the process priority, but would that completely stop the f@h if
> a recording starts, and then when the flagging is done after, f@h starts
> again? Or is that as simple as it sounds: giving the mythbackend the top dog
> priority when it starts recording/a job and sending f@h way down in cpu
> usage?
>
> Thanks a bunch
> Bob
>

Well, this is a *bit* of a simplification, but essentially the
nice/renice target gets "whatever's left." If everyone else uses 0%,
it takes 100%, 70%->30%, 100%->nothing.

Note if you are iobound this is NOT your solution, however....
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


yan at seiner

Apr 21, 2009, 1:33 PM

Post #5 of 12 (1086 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

On Tue, April 21, 2009 1:28 pm, Bobby Gill wrote:
>>
>>
>> man nice
>> man renice
>>
>> Basically set the priority to the lowest:
>>
>> IIRC something like
>>
>> renice 20 f@h
>>
>> should do the trick. I do the same thing; I have a huge ffmpeg job that
>> runs for about 10 minutes, hammering the drives and the CPU. It caused
>> all sorts of problems with myth until I re-niced it to the lowest level
>> possible.
>>
>> --Yan
>>
>
> Thanks Yan. So for my intermediate self, what is that doing? I don't have
> any man pages for nice/renice. I just googled and see that it is
> rescheduling the process priority, but would that completely stop the f@h
> if
> a recording starts, and then when the flagging is done after, f@h starts
> again? Or is that as simple as it sounds: giving the mythbackend the top
> dog
> priority when it starts recording/a job and sending f@h way down in cpu
> usage?
>

The latter. Basically, a process with a higher priority will get
resources before a process with a lower priority. (It's a bit more
complicated and I don't pretend to understand it but for country bumpkins
like me that explanation will suffice.)

So f@h is grinding along, sucking up 100% CPU, and then myth cranks up,
needs CPU cycles, and the f@h process will get less CPU. Lots less if
myth is high in the list and f@h is low.

I'm surprised you don't have man pages on those; AFAIK they're a basic
part of any *nix. Your distro must have them as an optional install.

--
Yan Seiner, PE

Support my bid for the 4J School Board
http://www.seiner.com

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


bobbygill at rogers

Apr 21, 2009, 1:40 PM

Post #6 of 12 (1084 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

>
> The latter. Basically, a process with a higher priority will get
> resources before a process with a lower priority. (It's a bit more
> complicated and I don't pretend to understand it but for country bumpkins
> like me that explanation will suffice.)
>
> So f@h is grinding along, sucking up 100% CPU, and then myth cranks up,
> needs CPU cycles, and the f@h process will get less CPU. Lots less if
> myth is high in the list and f@h is low.
>
> I'm surprised you don't have man pages on those; AFAIK they're a basic
> part of any *nix. Your distro must have them as an optional install.
>

Okay, thanks, that is pretty clear (even for me lol).

Note if you are iobound this is NOT your solution, however....


Can you explain this?


Thanks a bunch
Bob


david.schmidt.in.dallas at gmail

Apr 21, 2009, 1:43 PM

Post #7 of 12 (1081 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

On Tue, Apr 21, 2009 at 3:40 PM, Bobby Gill <bobbygill [at] rogers> wrote:
>> The latter.  Basically, a process with a higher priority will get
>> resources before a process with a lower priority. (It's a bit more
>> complicated and I don't pretend to understand it but for country bumpkins
>> like me that explanation will suffice.)
>>
>> So f@h is grinding along, sucking up 100% CPU, and then myth cranks up,
>> needs CPU cycles, and the f@h process will get less CPU.  Lots less if
>> myth is high in the list and f@h is low.
>>
>> I'm surprised you don't have man pages on those; AFAIK they're a basic
>> part of any *nix.  Your distro must have them as an optional install.
>
> Okay, thanks, that is pretty clear (even for me lol).
>
>> Note if you are iobound this is NOT your solution, however....
>
> Can you explain this?
>
>
> Thanks a bunch
> Bob
>

nice/renice throttle on the CPU. If no one is using CPU but thrashing
all trying to get to the disk, it won't be throttling at all,
effectively.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


jarpublic at gmail

Apr 21, 2009, 1:49 PM

Post #8 of 12 (1081 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

>
>> Note if you are iobound this is NOT your solution, however....
>
> Can you explain this?

Your CPU is actually only ever running one program at a time (with the
exception of hyper-threading). The way multitasking is done is the CPU
is interupted at regular intervals and it decides which program to run
during the next interval. Usually it does this switching frequently
enough that it is seemless to you. It appears that all of your apps
are running at the same time, when in reality they are each taking
turns at the CPU. When you renice a program you tell the CPU to give
that program lower priority and it won't get as much time on the CPU
as programs with higher priority.

If you are not CPU bound but are I/O bound then renice will happily
let your program have all the time it needs on the CPU and thus you
will still have I/O problem.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


bobbygill at rogers

Apr 21, 2009, 2:03 PM

Post #9 of 12 (1080 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

>
> >> Note if you are iobound this is NOT your solution, however....
> >
> > Can you explain this?
>
> Your CPU is actually only ever running one program at a time (with the
> exception of hyper-threading). The way multitasking is done is the CPU
> is interupted at regular intervals and it decides which program to run
> during the next interval. Usually it does this switching frequently
> enough that it is seemless to you. It appears that all of your apps
> are running at the same time, when in reality they are each taking
> turns at the CPU. When you renice a program you tell the CPU to give
> that program lower priority and it won't get as much time on the CPU
> as programs with higher priority.
>
> If you are not CPU bound but are I/O bound then renice will happily
> let your program have all the time it needs on the CPU and thus you
> will still have I/O problem.


Thanks a bunch, that's good info for me! So basically if the process isn't a
CPU hog like f@h, but rather something that's using the HD, then renice
isn't useful for /that/, right? That's good to know for future issues.

Thanks
Bob


mythtv at bektchiev

Apr 21, 2009, 2:32 PM

Post #10 of 12 (1076 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

On Tue, Apr 21, 2009 at 1:49 PM, Johnny <jarpublic [at] gmail> wrote:
>>
>>> Note if you are iobound this is NOT your solution, however....
>>
>> Can you explain this?
>
> [deleted]
>
> If you are not CPU bound but are I/O bound then renice will happily
> let your program have all the time it needs on the CPU and thus you
> will still have I/O problem.

In these cases you can use both nice/renice and ionice with newer kernels.

--dejan
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Apr 21, 2009, 2:36 PM

Post #11 of 12 (1076 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

On 04/21/2009 04:43 PM, David Schmidt wrote:
> nice/renice throttle on the CPU. If no one is using CPU but thrashing
> all trying to get to the disk, it won't be throttling at all,
> effectively.

Thus ionice, to ask the that the process doesn't get in the way of
others using the disk.

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


thomas.kammerer at xo

Apr 21, 2009, 4:35 PM

Post #12 of 12 (1073 views)
Permalink
Re: Folding@home, having it start/stop between recordings/jobs?? [In reply to]

On Tue, 2009-04-21 at 16:11 -0400, Bobby Gill wrote:
> I have set up folding [at] hom to run on my backend, however I'm wondering
> how I can have it so that f@h runs whenever the mythbackend is NOT
> recording? Since the f@h takes up 100% CPU (I have a P4 3.4ghz EE) I'd
> love to configure it so they run alternately. I know I can pop the
> rc.d/foldingathome stop/start in my crontab for whenever, but I'd like
> to take it that step further as indicated. Really appreciate any help,
> thanks a bunch.

You could just write your cronjob to check to see the current status of
your encoders and start/stop folding as needed. Maybe run the check
every 30 minutes or so.

wget -qO- localhost:6544 | grep -c "not recording."

That should return the total number of encoders in use.

m0t.



_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.