mysqld eating most of the battery

KDE 5, updated.

kcm module energy info (not found in system-settings, BTW) shows mysqld as using the most battery in the last hor/12 hours, twice what the next culprits (firefox, X) use, judging by the bar lengths.

Is that normal (I think not)? If not, what may be the cause? There was no significant CPU usage or HDD activity not initiated by the user.

This in an HP pavilion’s brand new battery being calibrated according to the supplier instructions (fill to 100%, let it deplete, rinse and repeat).

Ideas, anyone?
How may I determine why mysqld is so power-hungry? Could it be in use by firefox, that is usually running with multiple tabs open, but minimized?

@brunomcl:
My guess is Akonadi: <https://userbase.kde.org/Akonadi#Disabling_the_Akonadi_subsystem>.
If, on the other hand, you’re a KMail2 fan, like me, AFAICS it’s a case of “grin and bear it”.
[HR][/HR]Suggested Action Plan:

  • Raise a KDE Change Request (exactly how one may gently request a change by using the KDE BugZilla system, is something that I haven’t yet discovered).
  • Raise a discussion topic at the upcoming openSUSE Conference in May this year.

Ah, good idea, thank you. Also I’m not sure the energy info kcm module is 100% kosher. It’s not found in system-settings, so perhaps it might be “not ready for production”.
I’ll try other power monitoring tools during the next weekend and see how it goes.

Thanks again,

Bruno

Why should it be found in systemsettings?
It is no configuration module, it only displays information.
And the other kinfocenter modules cannot be found in systemsettings either.

Yes, kinfocenter does also use kcm’s (why invent something new if something existing would work as well…), but they don’t show up in systemsettings on purpose.

I have no idea whether that module works 100% correctly or not though.

Maybe because kcm = kconfig module? Development/Tutorials/KCM HowTo - KDE TechBase
Just my opinion, but it could very well be a secondary tab or button in the power management settings.

The point is, it doesn’t appear anywhere in the menu structure that I could see - not even as part of the kinfocenter you mentioned. I only found it, by accident actually, searching for “info”.

Neither do I. It doesn’t appear to refresh correctly when you change the period. Thus my comment about reliability.

As I wrote, kinfocenter reuses the kcm technology because it makes no sense to reinvent the wheel.

The corresponding .desktop files do specify that they are only intended for kinfocenter, not systemsettings though.
And the .desktop files also specify in which category they should show up. kinfocenter uses different categories than systemsettings.
On a more technical level: the .desktop files use different key words to specify the category: X-KDE-KInfoCenter-Category for kinfocenter and X-KDE-System-Settings-Parent-Category for systemsettings. Also, the X-KDE-ParentApp key is set to “kcontrol” for systemsettings modules, while it is set to “kinfocenter” for the others (it is possible to specify both).

Just my opinion, but it could very well be a secondary tab or button in the power management settings.

Well, would maybe be an option, yes.
Although, as mentioned, it is an information module and doesn’t offer any settings…

The point is, it doesn’t appear anywhere in the menu structure that I could see - not even as part of the kinfocenter you mentioned. I only found it, by accident actually, searching for “info”.

Hm?
What menu structure do you mean here?
It is hidden in the application menu on purpose (like all other systemsettings or kinfocenter modules), if that’s what you’re referring to.

It does show up in kinfocenter though:

I don’t remember exactly when it was introduced, but it must have been 5.5 or 5.6.

Or are you talking about something else?
I don’t see any way to “change the period” here…

PS, to go back to the original question:
This seems to be a “problem” in mysql (mariadb) itself. I see the same “energy consumption” when I quit Akonadi…
Of course by default mysqld is not running (Akonadi starts/uses it), but I do start it system-wide on boot here (and configured Akonadi and Amarok to use that system instance).

Whether it really drains/eats the battery I have no idea, I think the module just shows the wakeups/second and from a quick look at the code it gets the values from UPower… (so, if the values are wrong, it would be a “bug” on a lower level I suppose)
I have to admit that I never bothered about this “energy consumption” stuff at all though, as I only have desktop systems, no laptop.

Taking the case of this Leap 42.2 Laptop:

  • If the user isn’t using Akonadi at all (please note the KDE “how to disable Akonadi” URL below) then, the MySQL daemon doesn’t run, at all.

[HR][/HR]Taking a closer look at what’s going on here:

The Info Center energy reporting is checking the number of “wake-ups per second”:

  • The Fluendo CodeMeter (checks the trial version of the DVD Player) is posting about 107 wake-ups per second.
  • The Akonadi MySQL daemon is posting about 25 wake-ups per second.
  • The Firefox instance I’m using to write this is posting about 31 wake-ups per second.
  • The XFS AIL daemon is posting about 11 wake-ups per second.
  • The RCU Scheduler, KWin X11, Plasma Activity Manager, are each posting about 1 wake-up per second.

Leaving the Info Center running and looking at the processes with “top” gives another picture: CodeMeter and Firefox are using less than 1% CPU and the rest don’t even appear in the list.

Leaving the Info Center running and inspecting the processes with KSysGuard reveals the following after 1 hour uptime:

  • The Fluendo CodeMeter is inactive, has 10 threads and has used about 10 seconds user CPU time and about 23 seconds system CPU time.
  • The Akonadi MySQL daemon is inactive, has 29 threads and has used about 2 seconds user CPU time about 3 seconds system CPU time.
  • The XFS AIL daemon is inactive, has 1 thread and has used about 6 seconds system CPU time.
  • The RCU Scheduler wakes up occasionally, has 1 thread and has used about 2 seconds user CPU time about 5 seconds system CPU time.

Conclusion: the wake-ups indicated by the Info Center energy reporting are possibly an indication of which applications are candidates for the “battery eater of the day” prize but, it may be better to install and use the “powertop” package.

Unless something else runs it, e.g. Amarok uses it too.
Or you have enabled the system-wide mysql service, like I do.

OTOH, you can configure Akonadi to use sqlite instead, then it won’t start mysql.