Akonadi saturating the CPU ~100%

Having just upgraded to 15.1, I was disappointed to see an immediate recurrence of the bug where akonadi saturates the CPU (~100% utilisation) and thrashes the hard drive, effectively locking out the user (for at least an hour in my case). This may be because akonadi is doing a full-text index of all emails, and the only way to regain control is to cut power and reboot.

Does anyone know how to stop this behaviour? Would clearing the “full text index” checkbox on the folder properties “maintenamce” tab do the trick? Would it be necessary to do this for all folders & sub-folders, or only the top-level folders? And would that mean email searches would no longer work?

This bug has been reported many times on the KDE bug-tracking system, for example bug 367480 - see https://bugs.kde.org/show_bug.cgi?id=367480 - notes it’s a duplicate of 114 other bug reports which stretch from 2016 to September 2019. Is it ever likely to be fixed? Or does it indicate a fundamental architectural flaw in the whole KDE PIM ediface?

David L.

Did you see https://bugs.kde.org/show_bug.cgi?id=373443

There is talk of a workaround.

There is no fundamental flaw on my machine. Occasionally indexing doesn’t stop causing moderate activity. This can be fixed by restarting the indexing agent using akonadiconsole.

Yes, thanks, I read that bug report, and there are many like it. Most workarounds involve deleting files in ~/.config/akonadi/ but it seems akonadi just recreates them when it starts; I tried deleting <agent_config_akonadi_indexing_agent_changes.dat> and that’s exactly what happened.

I can report that clearing the “full text indexing” checkbox on top-level mail directories isn’t enough to stop this problem.

This bug makes Kmail essentially unusable, and I find it very hard to believe it’s been reported so many times over such a long period (3 years!) but with no resolution. Is ditching KDE PIM altogether and migrating to Thunderbird the only answer? I really can’t see any point in raising yet another bug report.

I don’t recall ever having this problem and I always have “also index file content” unticked in system settings>search. So maybe this is the answer for you.

Thanks for your reply! Would you please tell me the exact path to “also index file content” as that sounds like a good suggestion?

In 15.1 I found [Settings > System Settings > Workspace > Plasma Search > Desktop Search “Searches through files, emails and contacts”] and unticked that.

The same path also has a “File Search” item with a box “Enable File Search” with no explanation which was unticked to begin with.

Try this, not as root, but as your normal user:


akonadictl fsck
akonadictl vacuum
akonadictl restart

Simply throwing away the akonadi stuff in ~/.config is not the way to go. It destroys all configured accounts for email, calendaring, addressbook etc.

I click on the System Settings icon then in the SystemSettings window I click Search (within workspace section) The first screen is File Search and under that is ‘Enable File Search’ and ‘Also index file content’. On mine ‘Also index file content’ is always unticked.

Found it, thanks, file-search was unticked and “Also index file content” greyed out. I’ve unticked [Plasma Search > Desktop Search] too, as mentioned; I notice there’s an “akonadi - dolphin” process so perhaps akonadi is used for other things besides mail.

I’ll also go through the laborious process of unticking “Enable fulltext indexing” on the “maintenance” tab of every mail folder and sub-folder, which should fix the problem but might stop email text searches. I imagine the extent of this bug depends on the amount of mail a user has, and I have quite a lot, going back to the mid-1990s.

David

I don’t think so. On my machine kmail uses 3 local maildir folders with 58447 files in some 400 folders (5.7GB) dating back to 1995 and works fine. I do indexing and search works fine too. All settings are default. No tinkering needed.