Page 1 of 1

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

Posted: Tue May 05, 2020 11:02 am
by rickterowl
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

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

Posted: Tue May 05, 2020 3:43 pm
by bill6502
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.

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

Posted: Tue May 05, 2020 4:10 pm
by rickterowl
Result:

Code: Select all

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

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

Posted: Tue May 05, 2020 4:57 pm
by bill6502
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

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

Posted: Tue May 05, 2020 5:55 pm
by rickterowl
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             |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+------------------+

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

Posted: Tue May 05, 2020 6:03 pm
by paulh
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

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

Posted: Tue May 05, 2020 6:52 pm
by rickterowl
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

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

Posted: Tue May 05, 2020 8:32 pm
by paulh
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.

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

Posted: Mon May 11, 2020 4:57 pm
by srimbey
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.

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

Posted: Mon May 11, 2020 5:06 pm
by bill6502
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.)

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

Posted: Wed May 13, 2020 3:43 pm
by srimbey
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

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

Posted: Wed May 13, 2020 3:47 pm
by bill6502
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.

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

Posted: Sun May 17, 2020 3:34 pm
by srimbey
https://www.mythtv.org/wiki/XMLTV#MythTV_Setup

in section labled... run the configuration

Steve

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

Posted: Wed May 20, 2020 10:30 pm
by bill6502
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.