https://bugs.kde.org/show_bug.cgi?id=521123

            Bug ID: 521123
           Summary: Akonadi takes way too much CPU for some mailbox
    Classification: Frameworks and Libraries
           Product: Akonadi
      Version First 6.6.3
       Reported In:
          Platform: Debian testing
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Indexer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
  Target Milestone: ---

DESCRIPTION

Since a few weeks in debian testing, I observed that akonadi processes
for 1 mailbox (local folders) take way too much CPU. CPU usage goes up
periodically, the CPU fan would then start. In KDE's System Configuration
the file indexing is deactivated as well as PIM information.

STEPS TO REPRODUCE
1. have kmail auto start on login
2. log in your user account
3. observe the CPU usage

OBSERVED RESULT
The CPU usage is mostly due to several akonadi processes _indefinitely_ (the
processes never stop).

EXPECTED RESULT
The akonadi processes should stop quickly.

SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a
terminal window):
Operating System: Debian GNU/Linux forky/sid
KDE Plasma Version: 6.6.5
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.2
Kernel Version: 7.0.10+deb14-amd64 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
I made a shell script to stop that :

```bash
#!/bin/bash

regexp="akonadi_(indexing|maildir)"
threshold=9.0
count=0

killed=1

while [ $killed -gt 0 ]; do
        killed=0
        process_info=$(ps aux | grep -E "$regexp" | sort -n -k 3 | tail -n 1)
        cpu_load=$(echo "$process_info" | awk '{print $3}')

        while [ "$(echo "$cpu_load > $threshold" | bc -l)" -eq 1 ]; do

                bin=$(echo "$process_info" | awk '{print $11}')
                name=$(basename $bin)
                pid=$(echo "$process_info" | awk '{print $2}')

                echo "Process $name ($pid) CPU load is over $threshold
($cpu_load)"
                echo " -> Killing..."

                kill -9 $(echo "$process_info" | awk '{print $2}')
                count=$((count + 1))
                killed=$((killed + 1))

                sleep 2
                process_info=$(ps aux | grep -E "$regexp" | sort -n -k 3 | tail
-n 1)
                cpu_load=$(echo "$process_info" | awk '{print $3}')
                echo

        done
done

echo "Done. Killed $count processes."
```

And here is the result:

```bash
$ akonakill 
Process akonadi_indexing_agent (3167) CPU load is over 9.0 (38.3)
 -> Killing...

Process akonadi_maildir_resource (3168) CPU load is over 9.0 (14.3)
 -> Killing...

Process akonadi_indexing_agent (4233) CPU load is over 9.0 (56.3)
 -> Killing...

Process akonadi_indexing_agent (4297) CPU load is over 9.0 (27.5)
 -> Killing...

Done. Killed 4 processes.
```

Once done, the CPU load comes back to a normal, steady, value.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to