[mythtv-users] mythbackend sometimes goes to 100%

Daniel Kristjansson danielk at cuymedia.net
Sun Jun 28 02:17:13 UTC 2009

On Sat, 2009-06-27 at 10:24 +0100, Mike Perkins wrote:
> Udo van den Heuvel wrote:
> > 
> > A 100% CPU load is nothing wrong, per C. The particular circumstances
> > *may* point toward a problem.
> > You explain why it is a problem and how you got there.
> > 
> 100% cpu utilisation is almost certainly an indication that the system needs 
> *more* processor than is available. 100% is all that the cpu can give, by 
> definition. You have absolutely no idea how much is actually required, just that 
> your system is saturated.
> If your system shows somewhere between 80%-95% (roughly), I would agree with 
> you. You always need to keep a little margin to allow for occasion use by the 
> other processes in your machine. Like, for example syslogd or ntpd.

I have to agree with Udo. 100% CPU utilization does not mean anything
is wrong. The CPU is there to be used. Computers normally use 100% CPU
whenever not waiting on input or output. The backend periodically uses
100% CPU when performing CPU intensive tasks such as generating preview
frames or scheduling programs for recording. If the backend is consuming
100% CPU when not performing one of these normal, but CPU intensive,
tasks then there is cause for concern.

The OS process scheduler can and will take the CPU of this task when
another process needs the CPU. There is no need to release the CPU
at 80% or 95% utilization in a pre-emptive multitasking environment.

MythTV does release the CPU periodically when performing some low
priority, but I/O intensive tasks such as transcoding. But this is
not to free the CPU. This addresses a different problem. Most
operating systems, (including Linux, MS Windows, and Darwin) are
poor at scheduling I/O so a low priority process doing lots of I/O
can prevent a high priority process doing limited I/O from completing
it's task in a timely manner. (Google: priority inversion)

As to Adam's problem... MythWeb can trigger 100% CPU utilization
on the backend when you delete a program (rescheduling) or when
you trigger a new preview image to be generated for a program.
How long this state lasts and what you were doing are important
questions for ascertaining whether there is a bug or not.

-- Daniel

More information about the mythtv-users mailing list