Bug 417071

Summary: Akonadi is constantly writing to disk.
Product: [Frameworks and Libraries] Akonadi Reporter: Hakan Bayindir <hakan>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: major CC: hakan
Priority: NOR    
Version: 5.12.3   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: One day of iotop statistics, running in cumulative mode, sorted by disk write.

Description Hakan Bayindir 2020-02-02 19:15:48 UTC
Created attachment 125624 [details]
One day of iotop statistics, running in cumulative mode, sorted by disk write.

SUMMARY
Akonadi is constantly writing to disk and creating a lot of cumulative disk I/O after some time.

STEPS TO REPRODUCE
1. Run akonadi.
2. Leave it turned on for the day.
3. Enable indexer for better results.

OBSERVED RESULT
~3.5GB written to the disk after 10 hours of operation.

EXPECTED RESULT
A milder disk write pattern.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian Testing.
(available in About System)
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.5

ADDITIONAL INFORMATION
KMail is also managing a single IMAP account via Akonadi. Continually writing small amounts of data wears SSDs pretty fast.
Comment 1 Hakan Bayindir 2020-05-10 13:17:49 UTC
I have found the root cause of constant writing to disk, however it needed a good amount of digging with akonadiconsole.

A malformed e-mail was triggering akonadi indexer to constantly retry indexing a bunch of entries every two seconds or so. This caused constant writing to the disk.

Finding the offending collection ID and removing all mails (it was luckily trash) fixed the problem.

I'm leaving the state as REPORTED intentionally because I still think the behavior is suboptimal and I'm not knowledgeable enough to decide its future.

If the maintainers can do the right thing, I'd be grateful.