kontact / kmail very slow

Over the past 6 months or so, kmail has become progressively more and more slow. It now takes 5 minutes to retrieve folder contents for the inbox, and a similar time to retrieve an email.

Before I move to another mail client, can someone advise how I can:

  1. save the mail account configurations (I have 8)
  2. save the current emails downloaded (I use pop3)
  3. wipe kcontact, akonadi and all its files
  4. reinstall kontact and its dependencies
  5. restore from 1 & 2 to have a shiny new, fully populated install.

I should add that I’ve been running opensuse for more than 10 years, and have upgraded to new releases rather than reinstall. I suspect there’s a lot of cruft.

… or, is there a better way or other things I should check / fix before blasting the install?

Thanks
David

I’ve just checked, and .local/share/akonadi/search_db is 0.9GB and .local/share/akonadi/file_db_data is 7.2GB. Would this affect the speed?

That is really huge for the akonadi database. Mine in total is ~3.1GB, this for ~200.000 emails. But, what you can do is switch to using postgresql instead of mysql. In my experience ( and that of others ) it’s much faster. Instructions for doing so are easily found on docs.kde.org

Thanks. I think I’ve done this right … it’s certainly a lot faster on the initial startup (waiting for the database to populate).
Unfortunately, I couldn’t find the docs you mentioned, although I spent an hour searching. :frowning:
The best I found are https://vinzv.de/en/bringing-kmail-and-postgresql-together/ and AKAsistemas: Akonadi postgresql backend and Setting up Akonadi , which aren’t consistent.

I got a couple of crashes for akonadiserver during the startup … but the server seems to restart and continue …

My .config/akonadi/akonadiserverrc is:

[Debug]
Tracer=null

%General]
Driver=QPSQL

[QPSQL]
Host=/tmp/akonadi-david.hash
InitDbPath=/usr/bin/initdb
Name=akonadi
Options=
ServerPath=/usr/bin/pg_ctl
StartServer=true
User=david

Can you tell me if this is correct or do I need to change something to avoid the akonadiserver crashes?

Thanks
David

Hmmm … I’ve added a password to the postgres user and akonadiserverc, as I was getting ‘Pass a valid window to KWallet::Wallet::openWallet().’ as part of the output from akonadictl start … and I’m still getting the same output.

akonadiserver seems to be running. Safe to ignore?

for anyone finding this later … postgres requires single quotes when setting the password, and aknoadiserverc no quotes.

and here’s the best doc I can find for the akonadiserverrc for postgres: http://metadata.ftp-master.debian.org/changelogs/main/a/akonadi/stable_README.Debian

For others’ reference, the akonadiserverrc which seems to be working best for me is:

[Debug]
Tracer=null

%General]
Driver=QPSQL

[QPSQL]
Host=
InitDbPath=/usr/bin/initdb
Name=akonadi-david
Options=
Password=****
ServerPath=/usr/bin/pg_ctl
StartServer=false
User=david

It’s here: <https://userbase.kde.org/Akonadi/Postgres_update&gt; – last update: 15 March 2019, at 11:44.
[HR][/HR]

  • Found it in about 2 s with DuckDuckGo and the following search string: “KDE akonadi postgresql”.

Thanks. I found that. It looks, to me, to be instructions about how to upgrade the postgres database from one version to the next, rather than to transfer from mysql to postgres, but I could be wrong.

Hmmm … I’m going to have to find a different answer:

$ echo $(( $( ps -Aly x | egrep '[k]mail|[a]konadi|[p]ostgres' | gawk '{ print $8 }' | sed 's/$/ + /' | tr ':space:]' ' ' ) 0 ))
4006464

So I have an RSS of more than 4GB for the kmail / kontact related stuff … and I’m getting swapping whenever I do anything more than just gaze at the UI.

Thanks for your contributions, and I think I’m going to offload the problem to a mail server (such as zimbra) or collaboration (collabora + owncloud ?) VM and use a lightweight desktop client …

I suspect that, you’re not wrong …
Everything I’ve found seems to revolve around setting up with a PostgreSQL database but, nothing related to migrating from MySQL to PostgreSQL …

  • It seems that, you’ll have to ensure that, you have a good export of all your e-Mails and then, setup a fresh instance with a new Akonadi back-end …
  • I’ve occasionally experienced that, KMail2 displays a received e-Mail but, the thing isn’t in the Local Mail directory – I suspect that the Akonadi cache sometimes takes a while to write the mail to the directory …

<https://community.kde.org/PIM/Akonadi&gt;; <https://techbase.kde.org/KDE_PIM/Akonadi&gt;; <https://api.kde.org/kdepim/akonadi/html/server.html&gt;; <https://api.kde.org/kdepim/akonadi/html/akonadi_server_database.html&gt;; <https://api.kde.org/kdepim/akonadi/html/classAkonadi_1_1Server_1_1DataStore.html&gt;.

  • A little bit unsettling, in the last URL, the database access class description (Akonadi::Server::DataStore Class Reference) doesn’t mention PostgreSQL as being a supported QSql driver …