[Resolved] Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

For discussion of topics specific to MythTV on linux
Post Reply
rickterowl
Newcomer
Posts: 4
Joined: Tue May 05, 2020 10:46 am
United States of America

[Resolved] Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by rickterowl » Tue May 05, 2020 11:02 am

Hi!

I recently decided to pull the trigger and do a completely rebuild of my old myth-backend (only overlapping hardware is case, PS, and a 4TB movie storage drive). OS is Ubunutu 20.04 LTS. [I miss the ease of mythbuntu....]

While tracking thermal performance (I plan on downsizing the case), I noticed an odd behavior. Every ~1min, 1 core of my CPU (4-core) will jump up to100% for 10-15sec. This heats up the 1 core up, ~30C to 50C+. The culprit thread is /usr/sbin/mysqld. The behavior stops when I stop mythbackend.

While looking at the mythtbackend log, I see this repeating every 1min:
<log file>

Code: Select all

May  5 06:53:38 rickter-htpc mythbackend: mythbackend[17332]: I CoreContext housekeeper.cpp:754 (Run) Queueing HouseKeeperTask 'MythFillDB'.
May  5 06:53:38 rickter-htpc mythbackend: mythbackend[17332]: I HouseKeeping housekeeper.cpp:144 (Run) Running HouseKeeperTask 'MythFillDB'.
May  5 06:53:39 rickter-htpc mythbackend: mythbackend[17332]: I ProcessRequest mainserver.cpp:1768 (HandleAnnounce) MainServer: MainServer::ANN Playback
May  5 06:53:39 rickter-htpc mythbackend: mythbackend[17332]: I ProcessRequest mainserver.cpp:1770 (HandleAnnounce) MainServer: adding: rickter-htpc(55ab4c447cc0) as a client (events: 0)
May  5 06:53:58 rickter-htpc mythbackend: mythbackend[17332]: I Scheduler scheduler.cpp:2308 (HandleReschedule) Reschedule requested for MATCH 0 0 0 - MythFillDatabase
May  5 06:53:58 rickter-htpc mythbackend: mythbackend[17332]: I Scheduler scheduler.cpp:2425 (HandleReschedule) Scheduled 67 items in 0.0 = 0.02 match + 0.02 check + 0.01 place
May  5 06:53:58 rickter-htpc mythbackend: mythbackend[17332]: I MythSocketThread(44) mainserver.cpp:7856 (connectionClosed) Playback sock(55ab4c447cc0) 'rickter-htpc' disconnected
May  5 06:53:58 rickter-htpc mythbackend: mythbackend[17332]: I HouseKeeping housekeeper.cpp:164 (Run) HouseKeeperTask 'MythFillDB' Finished Successfully.
</log file>

Is this a bug in the MythFillDB task?? Does anyone else using Myth31 see this behavior? To be honest, if wasn't looking at thermal performance so closely, I likely would've missed it.

[btw -- nothing out of the ordinary in syslog]

Thanks,

-Rick
Last edited by rickterowl on Tue May 05, 2020 10:47 pm, edited 1 time in total.

User avatar
bill6502
Developer
Posts: 1683
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by bill6502 » Tue May 05, 2020 3:43 pm

Please paste the output of this (in the password prompt, use the one in ~mythtv/config.xml):

Code: Select all

mysql --user=mythtv --password --execute="SELECT * FROM housekeeping WHERE tag='MythFillDB'" mythconverg
I'm guessing the timestamp(s) are empty.

rickterowl
Newcomer
Posts: 4
Joined: Tue May 05, 2020 10:46 am
United States of America

Re: Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by rickterowl » Tue May 05, 2020 4:10 pm

Result:

Code: Select all

+------------+----------+---------------------+---------------------+
| tag        | hostname | lastrun             | lastsuccess         |
+------------+----------+---------------------+---------------------+
| MythFillDB | NULL     | 2020-05-05 16:09:38 | 2020-05-05 16:08:38 |
+------------+----------+---------------------+---------------------+

User avatar
bill6502
Developer
Posts: 1683
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by bill6502 » Tue May 05, 2020 4:57 pm

That helps, unfortunately it doesn't match the other instance reported on the mailing list. This please:

Code: Select all

mysql --user=mythtv --password --execute="SELECT * FROM settings WHERE value LIKE 'mythfill%'" mythconverg

rickterowl
Newcomer
Posts: 4
Joined: Tue May 05, 2020 10:46 am
United States of America

Re: Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by rickterowl » Tue May 05, 2020 5:55 pm

Hmm...this is interesting...could the non-NULL hostnames be the issue?

Code: Select all

+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+------------------+
| value                           | data                                                                                                                                    | hostname         |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+------------------+
| MythFillDatabaseArgs            |                                                                                                                                         | NULL             |
| mythfilldatabaseLastRunEnd      | 2020-04-29T03:57:57Z                                                                                                                    | NULL             |
| mythfilldatabaseLastRunStart    | 2020-04-29T03:53:15Z                                                                                                                    | NULL             |
| mythfilldatabaseLastRunStatus   | mythfilldatabase ran, but did not insert any new data into the Guide for 1 of 1 sources. This can indicate a potential grabber failure. | NULL             |
| MythFillDatabaseLog             |                                                                                                                                         | NULL             |
| MythFillDatabasePath            | /usr/bin/mythfilldatabase                                                                                                               | NULL             |
| MythFillEnabled                 | 1                                                                                                                                       | NULL             |
| MythFillFixProgramIDsHasRunOnce | 1                                                                                                                                       | rickter-frontend |
| MythFillFixProgramIDsHasRunOnce | 1                                                                                                                                       | rickter-htpc     |
| MythFillGrabberSuggestsTime     | 1                                                                                                                                       | NULL             |
| MythFillMaxHour                 | 5                                                                                                                                       | NULL             |
| MythFillMinHour                 | 2                                                                                                                                       | NULL             |
| MythFillPeriod                  | 1                                                                                                                                       | NULL             |
| MythFillSuggestedRunTime        | 2020-04-30T03:53:15Z                                                                                                                    | NULL             |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+------------------+

User avatar
paulh
Developer
Posts: 515
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by paulh » Tue May 05, 2020 6:03 pm

Try turning off the 'Run listings data program at time suggested' setting.

You will find it in mythtv-setup under 1. General -> Programme Schedule Downloading Options -> Automatically update programme listings

rickterowl
Newcomer
Posts: 4
Joined: Tue May 05, 2020 10:46 am
United States of America

Re: Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by rickterowl » Tue May 05, 2020 6:52 pm

Ha... that fixed it! What does that feature do?

Now..I just realized that I overlooked the fact that the last successful database fill was 4/29 (the day I built the machine). Now to figure out what is going on there. :-/

Thanks for the help!
-Rick

User avatar
paulh
Developer
Posts: 515
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by paulh » Tue May 05, 2020 8:32 pm

The old Schedules Direct grabber allowed SD to suggested a time that you should run mythfilldatabase. The idea was to spread the load that their servers would get across a 24 hour period rather than everyone running the grabber at 2am or whatever. I don't think it has a use any more so should I believe just default to running the grabber every 24 hours at roughly the same time each day but clearly something got broken. Maybe something was missed when the old SD support was removed or the code clean up has tended to break stuff that can go unnoticed until someone reports a fault.

srimbey
Newcomer
Posts: 4
Joined: Wed Feb 01, 2017 2:43 pm
United States of America

Re: [Resolved] Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by srimbey » Mon May 11, 2020 4:57 pm

I have this same problem. However, overheating or high cpu usage is not the issue. The mythfilldb is not working. Log shows successfull execution every minute but database is by now empty causing scheduled recordings to stop and listings guide to be empty.

Problem likely appeared 14 days prior to last entry in listing which is about time I upgraded to ubuntu 20.04.


May 11 12:50:25 steve-mythtv mythbackend: mythbackend[9379]: I CoreContext housekeeper.cpp:754 (Run) Queueing HouseKeeperTask 'MythFillDB'.
May 11 12:50:25 steve-mythtv mythbackend: mythbackend[9379]: I HouseKeeping housekeeper.cpp:144 (Run) Running HouseKeeperTask 'MythFillDB'.
May 11 12:50:27 steve-mythtv mythbackend: mythbackend[9379]: I ProcessRequest mainserver.cpp:1768 (HandleAnnounce) MainServer: MainServer::ANN Playback
May 11 12:50:27 steve-mythtv mythbackend: mythbackend[9379]: I ProcessRequest mainserver.cpp:1770 (HandleAnnounce) MainServer: adding: steve-mythtv(55ba3c0f1c00) as a client (events: 0)
May 11 12:50:28 steve-mythtv mythbackend: mythbackend[9379]: I Scheduler scheduler.cpp:2308 (HandleReschedule) Reschedule requested for MATCH 0 0 0 - MythFillDatabase
May 11 12:50:28 steve-mythtv mythbackend: mythbackend[9379]: I MythSocketThread(48) mainserver.cpp:7856 (connectionClosed) Playback sock(55ba3c0f1c00) 'steve-mythtv' disconnected
May 11 12:50:28 steve-mythtv mythbackend: mythbackend[9379]: I Scheduler scheduler.cpp:2425 (HandleReschedule) Scheduled 0 items in 0.0 = 0.00 match + 0.00 check + 0.01 place
May 11 12:50:28 steve-mythtv mythbackend: mythbackend[9379]: I HouseKeeping housekeeper.cpp:164 (Run) HouseKeeperTask 'MythFillDB' Finished Successfully.

User avatar
bill6502
Developer
Posts: 1683
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: [Resolved] Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by bill6502 » Mon May 11, 2020 5:06 pm

Hi,

Before going further, can we assume you followed the 2nd bullet here:
https://www.mythtv.org/wiki/Release_Not ... or_Changes

If so, the I'd run:

Code: Select all

sudo --set-home --login --user=mythtv mythfilldatabase -v system
and put the output in a pastebin and add its link here (if the answer isn't
obvious in the log output.)

srimbey
Newcomer
Posts: 4
Joined: Wed Feb 01, 2017 2:43 pm
United States of America

Re: [Resolved] Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by srimbey » Wed May 13, 2020 3:43 pm

ok... got it working.

in the instructions there is reference to a "configure" button that just is not there. finally figured out the command line method and got a proper config file.

there being so many variables in the hardware lashup the users may have put together it is not surprising that setup is a simple 17 step procedure :D

thank you all for mainting Mythtv.

steve

User avatar
bill6502
Developer
Posts: 1683
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: [Resolved] Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by bill6502 » Wed May 13, 2020 3:47 pm

Please mention the link to the instructions you're referring to.

Maybe it's old information that can be corrected. I don't recognize the
configure button.

srimbey
Newcomer
Posts: 4
Joined: Wed Feb 01, 2017 2:43 pm
United States of America

Re: [Resolved] Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by srimbey » Sun May 17, 2020 3:34 pm

https://www.mythtv.org/wiki/XMLTV#MythTV_Setup

in section labled... run the configuration

Steve

User avatar
bill6502
Developer
Posts: 1683
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: [Resolved] Myth31 /Ubuntu20.04 - mysqld CPU usage every 1 min (MythFillDB)

Post by bill6502 » Wed May 20, 2020 10:30 pm

Got it, thanks.

Per the earlier text: https://www.mythtv.org/wiki/XMLTV#MythTV_Setup
Depending on the grabber, it will prompt for any information it requires...
The Wiki is for all grabbers, apparently some have the Configure button.
Never saw it myself, but I've only ever used: tv_grab_zz_sdjson_sqlite.

Post Reply