Bug 271712

Summary: akonadi takes up 100% CPU load on an otherwise idling KDESC
Product: [Frameworks and Libraries] Akonadi Reporter: Rufus Dee <KDEBugs>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: bartotten, cfeck, mschoell, pragma, roger.larsson
Priority: NOR    
Version: 1.5.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: log from "akonadictl start"
Snapshot showing iowrites (and sporadic reads)

Description Rufus Dee 2011-04-25 21:22:38 UTC
Created attachment 59311 [details]
log from "akonadictl start"

Version:           1.5.2 (using KDE 4.6.2) 
OS:                Linux

Upon logging in to KDESC the system is very unresponsive. htop shows 100% CPU usage for both of my logged-in users (see screenie). Stopping akonadi on both accounts brings CPU usage down to some percents.

Reproducible: Always

Steps to Reproduce:
1. Log in to KDESC

Actual Results:  
2. run htop: see CPU usage at 100%
3. issue "akonadictl stop": CPU usage drops to approx. 10%
4. issue "akonadictl start": CPU usage rises, although only to ca. 50%

Expected Results:  
2. run htop: see CPU usage at approx. 10%
Comment 1 Christophe Marin 2011-05-01 11:40:33 UTC
which distribution ?
Comment 2 Christoph Feck 2011-05-04 15:02:04 UTC
The bug report says "Archlinux".
Comment 3 Christophe Marin 2011-05-04 16:20:58 UTC
Would be interesting to see the CMake output for kdelibs (specially the kidletime dependencies)
Comment 4 Rufus Dee 2011-05-13 12:22:27 UTC
I doubt I'm able to provide this information, since I downloaded the packages from some (official, btw) mirror. Am I wrong?
Comment 5 BartOtten 2011-10-04 21:54:35 UTC
I have the same behavior after setting up kmail. I am able to provide logs from akonadiconsole if that matters.
Comment 6 Szymon Stefanek 2011-12-26 01:27:00 UTC
In general, the whole akonadi+mysqld+resources+kmail subsystem takes huge amounts of CPU. For instance now I have:

 2397 ... 384m 138m 3088 S  118 ... mysqld                                                                                                                                                                          
 3048 ... 405m 133m  10m R   99 ... akonadi_mixedmaildir_resource                                                                                                                                                                
 3060 ... 618m 185m  10m S   51 ... akonadi_nepomuk_email_feeder

Where 118+99+51 = 268% is the CPU usage (on a quad-core system) and 138+133+185=456 is the resident (non shared) memory usage.
And this is with nepomuk disabled (why the email feeder is running?).

This doesn't happen only when checking mail. It happens also when a random folder is opened or even when kmail doesn't seem to do anything useful (or it's not even running).

If I look at akonadiconsole while the CPU usage is high I see that there is a very huge traffic between the components. Sometimes it seems to rescan some of my folders.
Comment 7 Szymon Stefanek 2011-12-27 01:34:28 UTC
The bug is still present in the kubuntu 4.7.90 (4.8 beta2) packages.
Comment 8 Roger Larsson 2012-01-13 08:37:11 UTC
Created attachment 67767 [details]
Snapshot showing iowrites (and sporadic reads)

Did some furter debugging, found out that writes goes to /home/roger/.config/akonadi/agent_config_akonadi_nepomuk_email_feeder_changes.dat


recvmsg(7, {msg_name(0)=NULL, msg_iov(1)=[{"maildir_resource_2\0\0\210\1\0\0\0\0\0\0\377\377\377\377"..., 2048}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 2048
recvmsg(7, {msg_name(0)=NULL, msg_iov(1)=[{"Source\0\0\0\0\0\0\3\1s\0\6\0\0\0notify\0\0\10\1g\0"..., 2048}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 2048
read(6, 0x6876b4, 4096)                 = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=6, events=POLLIN}, {fd=9, events=POLLIN}], 5, 0) = 1 ([{fd=7, revents=POLLIN}])
read(6, 0x6876b4, 4096)                 = -1 EAGAIN (Resource temporarily unavailable)
stat("/home/roger/.config/akonadi", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/home/roger/.config/akonadi/agent_config_akonadi_nepomuk_email_feeder_changes.dat", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 10
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
fstat(10, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(10, "\0\0\0\0\0\3$\242\0\0\0\27akonadi_mbox_resourc"..., 16366) = 16366
write(10, "akonadi_mbox_resource_0\0\0\0\2\0\0\0\1\0"..., 16382) = 16382
write(10, "\0\0\0\0\0\0\0002\377\377\377\377\377\377\377\377\0\0\0\34\0m\0e\0s\0s\0a\0g"..., 16362) = 16362
write(10, "\0001\0000\0007\0009\0000\0005\0003\0001\0007\0008\0.\0002\0004\0008\0001\0."..., 16368) = 16368
write(10, "akonadi_maildir_resource_2\0\0\0\2\0\0"..., 16384) = 16384
write(10, "\0\0\0\0\0\0\0\32akonadi_maildir_resource"..., 16378) = 16378
write(10, "\0\0\0\0\0\0\0\370\377\377\377\377\377\377\377\377\0\0\0\34\0m\0e\0s\0s\0a\0g"..., 16370) = 16370
write(10, "akonadi_maildir_resource_2\0\0\0\0\0\0"..., 16384) = 16384
write(10, "\0\0\0\1\0\0\0\0\0\0\0168\0\0\0002\0001\0000\0008\0003\0008\0008\0005\0003"..., 16362) = 16362
- - -

write(10, "kmailcvt-1942841066\0\0\0\2\0\0\0\1\0\0\0\0\0"..., 16375) = 16375
write(10, "kmailcvt-1942841066\0\0\0\2\0\0\0\1\0\0\0\0\0"..., 16375) = 16375
write(10, "kmailcvt-1942841066\0\0\0\2\0\0\0\1\0\0\0\0\0"..., 15996) = 15996
close(10)                               = 0
Comment 9 Roger Larsson 2012-01-13 08:43:04 UTC
Sorry, noticed the 100% - not the same bug. Will continue to search for a matching one (or write a new bug report...)
Comment 10 Vishesh Handa 2013-08-17 11:17:34 UTC
With 4.11, the nepomuk feeder should not do anything when Nepomuk is disabled. Previously it still used to record some changes.

Do you still get these kind of issues with 4.11?
Comment 11 Micha 2014-06-02 10:01:24 UTC
The same bug also affects Kubuntu 14.04 with KDE SC 4.13.0.

Also selecting a mail in kmail makes the CPU go up to 800% for a 3-4 seconds before dropping back to normal. 

Both mysqld and akonadi_server increaese the cpu load to 600% when checking for new mail check.
Comment 12 Denis Kurz 2016-09-24 20:37:35 UTC
This bug has only been reported for versions older than KDEPIM 4.14 (at most akonadi-1.3). Can anyone tell if this bug still present?

If noone confirms this bug for a recent version of akonadi (part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 13 Denis Kurz 2017-01-07 22:33:50 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.