Bug 410834 - Excessive Akonadi CPU and storage use
Summary: Excessive Akonadi CPU and storage use
Status: RESOLVED DUPLICATE of bug 403124
Alias: None
Product: kalarm
Classification: Applications
Component: Akonadi (show other bugs)
Version: unspecified
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: David Jarvie
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-12 02:52 UTC by BryanFRitt
Modified: 2019-08-17 14:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BryanFRitt 2019-08-12 02:52:24 UTC
SUMMARY

STEPS TO REPRODUCE ?
0. Upgrade Debian from Stretch(9) to Buster(10)
1. Start KAlarm
2. Let /usr/bin/akonadi_ical_resource run without killing it

OBSERVED RESULT
~/.local/share/akonadi_ical_resource_3/ will get filled up with bunches of
calendar.ics-XXXX wasting storage space (identical size..., different XXXX...)
while /usr/bin/akonadi_ical_resource consumes lots of CPU 

EXPECTED RESULT
not lots of CPU used, not lots of files made

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.54.0
Qt Version: 5.11.3

ADDITIONAL INFORMATION
A semi work around seams to be: 
end process akonadi/Kalarm
delete the files
set the directory to read only
restart KAlarm ...
CONS related to workaround? editing creates new alarm instead of editing
Comment 1 BryanFRitt 2019-08-12 03:57:37 UTC
Ops... I meant /usr/bin/akonadi_control was the one using CPU... 'End Process' this, and no more of those files will be created.
Comment 2 David Jarvie 2019-08-14 10:01:40 UTC
This bug report seems to relate to KOrganizer, since akonadi_ical_resource is nothing to do with KAlarm. KAlarm uses processes called akonadi_kalarm_resource.
Comment 3 BryanFRitt 2019-08-14 21:17:20 UTC
I purged anything to do with akonadi, set /home/bryan/.local/share/akonadi_ical_resource_3/ to read only then reinstalled back kde-full,

Now it looks like /usr/bin/akonadi_control > /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_0 is using lots of CPU and the lots of calendar.ics-NNNNNN are being put in ~/.local/share/akonadi_kalarm_resource_0/
They all show up with a length of 27033, but it looking at them with kdiff3 they appear to be different files.
NNNNNN is 1 to ??????
Comment 4 David Jarvie 2019-08-14 23:12:47 UTC
Can you please list all the akonadi_kalarm_resource_... processes which are running, so that I can check if there are more than there should be.

Which version of KAlarm or KDE Applications are you running?
Comment 5 BryanFRitt 2019-08-17 02:26:06 UTC
"Can you please list all the akonadi_kalarm_resource_... processes which are running, so that I can check if there are more than there should be.

Which version of KAlarm or KDE Applications are you running?"

How I can do the 1st paragraph?

KAlarm
Version 2.12.2
Stable Debian 10's KAlarm version, 4:18.08.3-1

Operating System: Debian GNU/Linux 10
KDE Plasma Version: 5.14.5
Qt Version: 5.11.3
KDE Frameworks Version: 5.54.0
Kernel Version: 4.19.0-5-amd64
...
Comment 6 BryanFRitt 2019-08-17 02:37:48 UTC
Is something like this what your looking for?
[ shortened the output for ps aux | grep akonadi ]
grep akonadi
/usr/bin/akonadi_control
/usr/bin/akonadiserver
/usr/sbin/mysqld --defaults-file=/home/bryan/.local/share/akonadi/mysql.conf --datadir=/home/bryan/.local/share/akonadi/db_data/ --socket=/tmp/user/1000/akonadi-bryan.2FvWka/mysql.socket --pid-file=/tmp/user/1000/akonadi-bryan.2FvWka/mysql.pid
/usr/bin/akonadi_akonotes_resource --identifier akonadi_akonotes_resource_3
/usr/bin/akonadi_akonotes_resource --identifier akonadi_akonotes_resource_7
/usr/bin/akonadi_archivemail_agent --identifier akonadi_archivemail_agent
/usr/bin/akonadi_birthdays_resource --identifier akonadi_birthdays_resource
/usr/bin/akonadi_contacts_resource --identifier akonadi_contacts_resource_0
/usr/bin/akonadi_followupreminder_agent --identifier akonadi_followupreminder_agent
/usr/bin/akonadi_ical_resource --identifier akonadi_ical_resource_0
/usr/bin/akonadi_ical_resource --identifier akonadi_ical_resource_2
/usr/bin/akonadi_ical_resource --identifier akonadi_ical_resource_3
/usr/bin/akonadi_ical_resource --identifier akonadi_ical_resource_4
/usr/bin/akonadi_indexing_agent --identifier akonadi_indexing_agent
/usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_0
/usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_1
/usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_2
/usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_5
/usr/bin/akonadi_maildir_resource --identifier akonadi_maildir_resource_0
/usr/bin/akonadi_maildispatcher_agent --identifier akonadi_maildispatcher_agent
/usr/bin/akonadi_mailfilter_agent --identifier akonadi_mailfilter_agent
/usr/bin/akonadi_migration_agent --identifier akonadi_migration_agent
/usr/bin/akonadi_newmailnotifier_agent --identifier akonadi_newmailnotifier_agent
/usr/bin/akonadi_notes_agent --identifier akonadi_notes_agent
/usr/bin/akonadi_sendlater_agent --identifier akonadi_sendlater_agent
Comment 7 David Jarvie 2019-08-17 12:20:30 UTC
That's the output I was looking for. It looks likely that you have a duplicate Akonadi resource for KAlarm. This bug has been fixed in the KDE Applications 19.08 release, but meanwhile you can fix it as follows:

1) Run akonadiconsole (which is provided by the package of the same name).

2) In its 'Agents' tab, find each of the KAlarm agents in turn, and for each, click Configure -> Natively. This will display the file name of the calendar which that agent uses. Note the file name for each KAlarm agent.

3) If there are two agents which use the same file, remove one of them by selecting it and clicking the Remove button.


Note that your output also shows that you have 4 personal calendar (iCal file) resources. You could try the same process to remove any duplicates for those, which might possibly prevent so many ~/.local/share/akonadi_ical_resource_* files being created. As I said before, these are not related to KAlarm, but again, duplicate resources are likely to use extra CPU and temporary file space.

*** This bug has been marked as a duplicate of bug 403124 ***
Comment 8 BryanFRitt 2019-08-17 12:34:58 UTC
Note:
"Mid-air collision detected!

Someone else has made changes to bug 410834 at the same time you were trying to"

Here's what I typed during the collision period...

ps aux | grep akonadi | sed 's/  \+/ /g' | cut -d\  -f11-
Is a command that does the above comment's shorting.
---
Looking at System Monitor(5.14.5) and copy/pasting from above list, it looks like the are using IO Write:

/usr/bin/akonadiserver
/usr/sbin/mysqld --defaults-file=/home/bryan/.local/share/akonadi/mysql.conf --datadir=/home/bryan/.local/share/akonadi/db_data/ --socket=/tmp/user/1000/akonadi-bryan.5WjLTw/mysql.socket --pid-file=/tmp/user/1000/akonadi-bryan.5WjLTw/mysql.pid

/usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_0

/usr/bin/akonadi_ical_resource --identifier akonadi_ical_resource_3
---
~/.local/share/akonadi_kalarm_resource_0/
is still getting filled with calendar.ics-NNNN

~/.local/share/akonadi_ical_resource_3/
isn't getting written to because I had set the folder to read only, but
as soon I give write permissions to this folder,
a bunch of calendar.ics-NNNN start getting written

in both folders the files being created are 27033 Bytes
Comment 9 BryanFRitt 2019-08-17 13:00:06 UTC
(In reply to David Jarvie from comment #7)
> That's the output I was looking for. It looks likely that you have a
> duplicate Akonadi resource for KAlarm. This bug has been fixed in the KDE
> Applications 19.08 release, but meanwhile you can fix it as follows:
> 
> 1) Run akonadiconsole (which is provided by the package of the same name).
> 
> 2) In its 'Agents' tab, find each of the KAlarm agents in turn, and for
> each, click Configure -> Natively. This will display the file name of the
> calendar which that agent uses. Note the file name for each KAlarm agent.
> 
> 3) If there are two agents which use the same file, remove one of them by
> selecting it and clicking the Remove button.
> 
> 
> Note that your output also shows that you have 4 personal calendar (iCal
> file) resources. You could try the same process to remove any duplicates for
> those, which might possibly prevent so many
> ~/.local/share/akonadi_ical_resource_* files being created. As I said
> before, these are not related to KAlarm, but again, duplicate resources are
> likely to use extra CPU and temporary file space.
> 
> *** This bug has been marked as a duplicate of bug 403124 ***

Thanks David Jarvie, This fixed it!

"these are not related to KAlarm", 
Should the "Product" for this bug be changed to "Akonadi" or something else?
Comment 10 David Jarvie 2019-08-17 14:48:26 UTC
Reassigning this bug report would be confusing, since much of it relates to KAlarm. If you want the akonadi_ical_resource CPU or file usage to be investigated, you should create a new bug report for Product "Akonadi" and component "iCal file resource" (and obviously only include information about akonadi_ical_resource issues).

Before submitting the new bug report, check whether there any duplicate akonadi_ical_resource agents using akonadiconsole, and if there are, give details in the report.