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

Mailing List Archive: MythTV: Dev

Is it normal to rerun the same select query every 8 seconds?

 

 

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


goeran at uddeborg

Aug 27, 2012, 9:13 AM

Post #1 of 6 (981 views)
Permalink
Is it normal to rerun the same select query every 8 seconds?

I moved the database server to a different machine than where the
backend and default frontend is running. That made me notice that the
mysqld daemon was actually using a noticeable amount of CPU time.
I enabled tracing, and saw that the vast majority of events sers
processing of select calls like this one:

Execute SELECT chanid, useonairguide, channel.sourceid FROM channel, dtv_multiplex WHERE serviceid = 5620 AND networkid = 8945 AND transportid = 1021 AND channel.mplexid = dtv_multiplex.mplexid

It is repeated over and over for different combinations of serviceid,
networkid and transportid. I traced a little over an hour, and got a
total of almost 90000 such selections, or around 21 a second.
Checking a particular combination of values to select, I got around
one such particular query every 8 seconds.

When I run some of the selections manually, I get an empty set all the
time. (I haven't tried all of them.) Which makes me even more
suspicious of this.

Things do work. The server is able to handle the work, and watching
TV works as expected. But it appears a bit strange, and I got a bit
suspicious. So I thought I could ask: is it really normal? Does it
make sense for MythTV to repeat these questions over and over? Or
could it be an indication of some bug that should be traced? Either
in MythTV or in my configuration?
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


dekarl at spaetfruehstuecken

Aug 27, 2012, 9:56 AM

Post #2 of 6 (933 views)
Permalink
Re: Is it normal to rerun the same select query every 8 seconds? [In reply to]

On 27.08.2012 18:13, Göran Uddeborg wrote:
> Execute SELECT chanid, useonairguide, channel.sourceid FROM channel, dtv_multiplex WHERE serviceid = 5620 AND networkid = 8945 AND transportid = 1021 AND channel.mplexid = dtv_multiplex.mplexid

...

> When I run some of the selections manually, I get an empty set all the
> time. (I haven't tried all of them.) Which makes me even more
> suspicious of this.
>
> Things do work. The server is able to handle the work, and watching
> TV works as expected. But it appears a bit strange, and I got a bit
> suspicious. So I thought I could ask: is it really normal? Does it
> make sense for MythTV to repeat these questions over and over? Or
> could it be an indication of some bug that should be traced? Either
> in MythTV or in my configuration?

Sounds like the active EIT scanner trying to find the channel for
received EIT data but failing. As there is no negative cache it is
trying over and over again.

Did you delete unwanted channels instead of marking them invisible?

http://code.mythtv.org/cgit/mythtv/tree/mythtv/libs/libmythtv/eithelper.cpp#n657

Looking at the code we don't cache channels that have useonairguide
disabled. Might be a nice optimization to cache these hits at least.

Regards,
Karl
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


dekarl at spaetfruehstuecken

Aug 27, 2012, 12:41 PM

Post #3 of 6 (926 views)
Permalink
Re: Is it normal to rerun the same select query every 8 seconds? [In reply to]

Göran,

I have posted a patch based on your question at
http://code.mythtv.org/trac/ticket/11053

Btw, you can check with dvbsnoop's section scan. There should be one
event_information_section per SQL query. Plus the sections relating to
channels with useonairguide=true.

Regards,
Karl
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


goeran at uddeborg

Aug 27, 2012, 1:52 PM

Post #4 of 6 (926 views)
Permalink
Re: Is it normal to rerun the same select query every 8 seconds? [In reply to]

> Did you delete unwanted channels instead of marking them invisible?

I'm not sure. It has been some time since we configured this. But
maybe we did.

My "channel" table contains 14 entries, which is much less than the
transmitter has.
(http://www.teracom.se/Sandarinformation/Frekvenstabeller/Detaljer/?ft=tv&sid=G/BM
It is in Swedish, but probably pretty obvious.) If that means we
deleted things, then we obviously did.

> I have posted a patch based on your question at

Nice! :-) I even think I understood it. :-)

> Btw, you can check with dvbsnoop's section scan.

I couldn't find anything called "dvbsnoop" on my machine, nor in
Fedora's repositories. Are you talkning about this tool from
Sourceforge?

http://dvbsnoop.sourceforge.net/
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


dekarl at spaetfruehstuecken

Aug 27, 2012, 2:12 PM

Post #5 of 6 (936 views)
Permalink
Re: Is it normal to rerun the same select query every 8 seconds? [In reply to]

On 27.08.2012 22:52, Göran Uddeborg wrote:
>> Did you delete unwanted channels instead of marking them invisible?
>
> I'm not sure. It has been some time since we configured this. But
> maybe we did.
>
> My "channel" table contains 14 entries, which is much less than the
> transmitter has.
> (http://www.teracom.se/Sandarinformation/Frekvenstabeller/Detaljer/?ft=tv&sid=G/BM
> It is in Swedish, but probably pretty obvious.) If that means we
> deleted things, then we obviously did.

it is also possible that you did not add encrypted and radio channels
in the first place. There are option in the channel scanner to omit
them.

>> I have posted a patch based on your question at
>
> Nice! :-) I even think I understood it. :-)
>
>> Btw, you can check with dvbsnoop's section scan.
>
> I couldn't find anything called "dvbsnoop" on my machine, nor in
> Fedora's repositories. Are you talkning about this tool from
> Sourceforge?
>
> http://dvbsnoop.sourceforge.net/

yes, http://www.linuxtv.org/wiki/index.php/Dvbsnoop says
"not on Fedora", too :)

The EIT section scan will look something like this:
http://dvbsnoop.sourceforge.net/examples/example-eit.html

each event_information_section will begin with (among others) the
following attributes:

Service_ID: 47 (0x002f) [= --> refers to PMS program_number]
...
Transport_stream_ID: 33 (0x0021)
Original_network_ID: 133 (0x0085) [= BetaTechnik | BetaTechnik]

which should match your database queries (The ONID is called NID in
MythTV for historical reasons)

Regards,
Karl
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


goeran at uddeborg

Aug 27, 2012, 2:33 PM

Post #6 of 6 (925 views)
Permalink
Re: Is it normal to rerun the same select query every 8 seconds? [In reply to]

Karl Dietz:
> it is also possible that you did not add encrypted and radio channels
> in the first place. There are option in the channel scanner to omit
> them.

That would explain it! If there was such an option, we most likely
selected it. We have no plans to watch any such channels.

> > Fedora's repositories. Are you talkning about this tool from
> > Sourceforge?
> >
> > http://dvbsnoop.sourceforge.net/
>
> yes,

Ok, I'll check it out.

Thanks for all your help!

> http://www.linuxtv.org/wiki/index.php/Dvbsnoop says
> "not on Fedora", too :)

I see. Sounds like one more thing to put on my to-do-list. :-)
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev

MythTV dev 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.