Excessive consumption RAM of mysqld daemon in Ubuntu 16.04

Bug #1576930 reported by VaryHeavy
98
This bug affects 19 people
Affects Status Importance Assigned to Milestone
Akonadi
New
Undecided
Unassigned
akonadi (Ubuntu)
High
Unassigned
mysql-5.7 (Ubuntu)
High
Unassigned

Bug Description

[Status]

Suspected cause is triaged upstream in MySQL; awaiting fix.

[Workaround]

Proposed in comment 10; please report success or failure.

[Original Description]

In the last days using Kubuntu 16.04 I've noticed that after a while of use, RAM consumption of mysqld daemon rises above 800 MB, even surpassing Firefox, as you can see in the attached images.

Initially, when system is just booted, RAM consumption of mysqld daemon it remains approximately 135-140 MB, but I have seen how after a while, in a matter of a few minutes, without touching anything, consumption rises progressively to around 830 MB.
In the second image you can see that mysqld daemon is related to Akonadi, which at the same time has a lot of threads running. It is possible that the problem is in managing Akonadi processes, but it is clear that consumption of mysqld daemon is not normal, and that there must be a problem, either MySQL or Akonadi, causing this situation.

I tried replacing MySQL with MariaDB, but will not let me uninstall MySQL components without also uninstall a lot of applications as dependencies (like Akonadi, Amarok, Kontact, KAdressBook ...). What I can do, even as an interim solution?

Here are the attached screenshots:
https://www.sendspace.com/file/712oyk
https://www.sendspace.com/file/qcqeem

VaryHeavy (varyheavy)
affects: ubiquity (Ubuntu) → mysql-5.5 (Ubuntu)
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Ubuntu 16.04 does not have MySQL 5.5, it has 5.7. The most likely explanation for the memory usage going up is that default buffer sizes have been increased significantly for mysqld over the last few releases. You may need to edit config files to reduce the buffers.

affects: mysql-5.5 (Ubuntu) → mysql-5.7 (Ubuntu)
Changed in mysql-5.7 (Ubuntu):
importance: Undecided → High
tags: added: xenial
Revision history for this message
Robie Basak (racb) wrote :

akonadi package configures its own mysqld, so any configuration changes for akonadi users need to be made in akonadi packaging and not mysql packaging.

akonadi packagers/Kubuntu team: I'm happy to help with this, let me know. It probably makes more sense for someone familiar with Kubuntu and/or akonadi to figure out what is needed on that side, though?

affects: mysql-5.7 (Ubuntu) → akonadi (Ubuntu)
Revision history for this message
Christophe (touil1976) wrote :

Same problem for me, not with akonadi, simply by installing mysql. mysqld uses approximately 130Mb at startup and goes up to 806 Mb adter 10 minutes, without any server process running.

Any workaround yet ?

Revision history for this message
Christophe (touil1976) wrote :

I must add that I use Ubuntu 16.04 too. (not Kubuntu)

Revision history for this message
Norvald H. Ryeng (nryeng) wrote :

It might be this bug: http://bugs.mysql.com/bug.php?id=80772

Can try the workaround mentioned in the bug report?

Revision history for this message
Philip Muškovac (yofel) wrote :

Regarding switching to MariaDB, that is supported, but you need to replace mysql with mariadb in one go:

# apt-get install mariadb-client-core-10.0 mariadb-server-core-10.0

should give you:

The following packages will be REMOVED:
  mysql-client-core-5.7 mysql-server-core-5.7
The following NEW packages will be installed:
  libreadline5 mariadb-client-core-10.0 mariadb-common mariadb-server-core-10.0

Changed in akonadi (Ubuntu):
status: New → Confirmed
Revision history for this message
Robie Basak (racb) wrote : Re: [Bug 1576930] Re: Excessive consumption RAM of mysqld daemon in Kubuntu 16.04

On Mon, May 02, 2016 at 12:52:44PM -0000, Philip Muškovac wrote:
> Regarding switching to MariaDB, that is supported, but you need to
> replace mysql with mariadb in one go:
>
> # apt-get install mariadb-client-core-10.0 mariadb-server-core-10.0

Note that migrating your data back to MySQL is generally not possible, so back
up your data first. MySQL/MariaDB packaging cannot currently do it anyway. I'm
not sure about akonadi.

Revision history for this message
Philip Muškovac (yofel) wrote : Re: Excessive consumption RAM of mysqld daemon in Kubuntu 16.04

> I'm not sure about akonadi.

It can't.

I meant we support it packaging wise as some people prefer to use another MySQL backend. But once you do that you're on your own.

Revision history for this message
Robie Basak (racb) wrote :

If this is the upstream MySQL bug that Norvald mentioned, then the fix would be in mysql-5.7, so adding a task for that. We can mark one of the tasks as Invalid when we figure out which is right.

Revision history for this message
Robie Basak (racb) wrote :

So the workaround suggested upstream is to add:

innodb-read-io-threads=1
innodb-write-io-threads=1

to

~/.local/share/akonadi/mysql.cnf

Can someone please confirm if this is accurate and if it works? We'll need to wait for a fix from upstream, but in the meantime hopefully the workaround will work for those affected.

description: updated
Changed in mysql-5.7 (Ubuntu):
status: New → Triaged
importance: Undecided → High
Robie Basak (racb)
description: updated
Revision history for this message
Lemmiwinks (lemmiwinks) wrote :

The workaround in comment #10 seems to work for me. Memory usage is now at around 200 MB.

Conf file is:
~/.local/share/akonadi/mysql.conf -> add under [mysqld]

Revision history for this message
Robie Basak (racb) wrote :

Thank you for confirming, this is useful. We'll wait for a fix from MySQL upstream, then.

Revision history for this message
Lemmiwinks (lemmiwinks) wrote :

Unfortunately it actually does not seem to solve the problem. Memory usage is already up to more than 500 MB. Sorry for not testing long enough obviously.

Revision history for this message
Lemmiwinks (lemmiwinks) wrote :

Is there any progress on this bug? I'm burning my SSD drive because of memory swapping...

Revision history for this message
Lemmiwinks (lemmiwinks) wrote :

Mysql version 5.7.12-0ubuntu1.1 from ubuntu proposed repo does not fix this bug.

Revision history for this message
Alexandr (xellgf2013) wrote :

The problem is observed on the mysql-5.7

Changed in mysql-5.7 (Ubuntu):
status: Triaged → Confirmed
Philip Muškovac (yofel)
Changed in mysql-5.7 (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Carlos (carlos-camara) wrote :

Workaround on comment #10 seemed to work for me, but after some time memory consumption started to grow up to 957MB

Revision history for this message
Stefan (spbkslx) wrote :

Seems to be fixed for me with mysql 5.7.13 from yakkety.
RAM consumtion dropped from ~900 to ~200 MB.

Colan Schwartz (colan)
Changed in akonadi:
importance: Unknown → Undecided
status: Unknown → New
Revision history for this message
Colan Schwartz (colan) wrote :

This is happening on Ubuntu Server as well; updated title.

Looks like this is now fixed upstream. Can we get the fix in the stable package? Thanks!

summary: - Excessive consumption RAM of mysqld daemon in Kubuntu 16.04
+ Excessive consumption RAM of mysqld daemon in Ubuntu 16.04
Revision history for this message
Colan Schwartz (colan) wrote :

This should be fixed now with the recent security releases in the stable channel. We should be at 5.7.15 which is fixed upstream. Can someone confirm?

Revision history for this message
Colan Schwartz (colan) wrote :

Confirming that my memory footprint for MySQL dropped significantly after installing the latest software updates.

Changed in mysql-5.7 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.