[mythtv] Watching Live TV & method TV::GetChannelInfo getting called every second

Tako Schotanus quintesse at palacio-cristal.com
Thu Jul 15 16:33:08 EDT 2004


J. Donavan Stanley wrote:

> Isaac Richards wrote:
>
>> On Thursday 15 July 2004 02:10 pm, Tako Schotanus wrote:
>>  
>>
>>> Isaac Richards wrote:
>>>   
>>>
>>>> On Thursday 15 July 2004 12:43 pm, Buechler, Mark R wrote:
>>>>     
>>>>
>>>>> Admittedly, I'm working with a two day old copy of CVS but I've 
>>>>> seen this
>>>>> for a few weeks now. I see on my backend mysqld running at 45-55% 
>>>>> CPU and
>>>>> the frontend taking more CPU than it should as well. I tracked it 
>>>>> down to
>>>>> a SQL statement running every second getting channel information 
>>>>> while
>>>>> watching live TV.
>>>>>
>>>>> I was wondering if anyone might know why
>>>>>       
>>>>
>>>> LCD info updater.  I didn't realize it was going every second, I'll 
>>>> bump
>>>> it up a lot, or actually, now that I look at this, I don't think it's
>>>> thread safe at all..
>>>>     
>>>
>>> Sorry, had no idea that GetChannelInfo would hit the database so much.
>>> It did this every second so you could see program info changes while
>>> watching live tv.
>>>
>>> So now I've got two questions because I really want this to work (and
>>> I'm not the only one for sure).
>>>
>>> 1. Is there a way to get this channel information without hitting the
>>> database so much? (Is there a function that does local caching of the
>>> results for eample?)
>>>   
>>
>>
>> Why not just check every minute or so, instead of every second?
>>
>
> Or check it 1) When the channel changes 2) when the current program is 
> over.  That way you have the least impact possible, and you have up to 
> date info.
>
True and situation 1 is already handled more or less but handling 
situation 2 just seemed to add too much complexity with just a very 
local gain (the code would only be useful for the LCD update code while 
the "caching" might be usefull for others as well). And using a very 
simple system to remember the last requested program info would not have 
been thread safe. Although it seems I broke things anyway ;-)

-Tako




More information about the mythtv-dev mailing list