Bug 317470 - mysqld take lot of CPU usage when Akonadi is enabled (4.10.41)
Summary: mysqld take lot of CPU usage when Akonadi is enabled (4.10.41)
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-28 00:21 UTC by Aristide
Modified: 2013-12-06 17:30 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
gdb output (give by thread apply all bt) (34.33 KB, text/plain)
2013-03-28 10:39 UTC, Aristide
Details
list of job from akonadiconsole (228.76 KB, image/png)
2013-11-12 14:44 UTC, Nolwenn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aristide 2013-03-28 00:21:42 UTC
Hi ! I have a big problem with Akonadi, since update from KDE 4.10.40 to 4.10.41.

When Akonadi is enabled, mysqld is used with 25% of CPU. After many audits for mysql, I have this values

→ Akonadi appear 35 times in « processlist » in : mysqladmin -u root -p processlist
→ Same command but with status, give : « Uptime: 6049  Threads: 36  Questions: 10240323  Slow queries: 0  Opens: 321  Flush tables: 1  Open tables: 64  Queries per second avg: 1692.895 »  ... 1692.895 Querys per seconds ... 
→ Akonadi like to run : « SELECT MimeTypeTable.id, MimeTypeTable.name FROM MimeTypeTable INNER JOIN CollectionMimeTypeRelation ».

Ask me if you need more informations, what do you want and more :)




Reproducible: Always




I use External mysql database for Akonadi (with dbs_akonadi for database name, and akonadidb for username, in localhost.
Comment 1 Aristide 2013-03-28 10:39:54 UTC
Created attachment 78452 [details]
gdb output (give by thread apply all bt)

Output log of gdb (give by « thread apply all bt ») when akonadiserver and mysqld take lot of CPU (for long time ... Very long time)
Comment 2 Aristide 2013-03-28 14:56:00 UTC
I want to add a thing : This bug appear when I launch kmail
Comment 3 Alexander Opitz 2013-10-21 21:25:43 UTC
I can confirm this behavior while using KMail.

The query: "SELECT MimeTypeTable.id, MimeTypeTable.name FROM MimeTypeTable INNER JOIN CollectionMimeTypeRelation" seems to be the most one which is running.

mysql> \s
--------------
mysql  Ver 14.14 Distrib 5.5.32, for debian-linux-gnu (x86_64) using readline 6.2

Connection id:          30
Current database:       akonadi
Current user:           opi@
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.5.32-0ubuntu7 (Ubuntu)
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /tmp/akonadi-opi.vFIsdl/mysql.socket
Uptime:                 2 hours 36 min 26 sec

Threads: 28  Questions: 30927431  Slow queries: 0  Opens: 174  Flush tables: 1  Open tables: 48  Queries per second avg: 3295.059
--------------


Around 3300 queries per second. *wow*
Comment 4 Alexander Opitz 2013-10-21 21:30:50 UTC
A second query seems to their very often (from show processlist)

 SELECT CollectionTable.id, CollectionTable.remoteId, CollectionTable.remoteRevision, CollectionTable
Comment 5 Daniel Vrátil 2013-10-22 12:38:30 UTC
Could you start Akonadi Console, enable "Job Tracker" and make a screenshot of running jobs (there should be only one, but can have subjobs) once Akonadi/MySQL starts going nuts?

From the backtrace (and the SQL query) it's clear that Akonadi is being asked for list of collections very often. I suspect an issue I've seen lately myself, but need confirmation.
Comment 6 Daniel Vrátil 2013-10-24 15:34:51 UTC
(In reply to comment #2)
> I want to add a thing : This bug appear when I launch kmail

I just noticed this comment: when you open Akonadi Console and in Browser tab check "Local Folders", are there any duplicated collections?
Comment 7 Nolwenn 2013-11-12 14:44:06 UTC
Created attachment 83519 [details]
list of job from akonadiconsole

list of job from akonadiconsole
Comment 8 Nolwenn 2013-11-12 14:47:03 UTC
I send a screenshot from akonadiconsole jobtracker. These jobs appear in less than a half second. 
I use package from archlinux repos and akonadiserver consume lof of cpu since 4.11.3 update.
Comment 9 Daniel Vrátil 2013-11-12 15:13:26 UTC
Open Akonadi Console, go to Browser tab, and check whether there are any duplicated folders in "Local Folders" folder - if yes, delete the duplicated folders and it should stop.
Comment 10 Nolwenn 2013-11-12 15:23:46 UTC
(In reply to comment #9)
> Open Akonadi Console, go to Browser tab, and check whether there are any
> duplicated folders in "Local Folders" folder - if yes, delete the duplicated
> folders and it should stop.

I had two trash folder, I delete one of them and now it works fine. Thank you.