Discussion:
Caching local resources
Shridhar Daithankar
2018-09-07 14:41:21 UTC
Permalink
Hello,

I was wondering if akonadi caches local resources as well? If yes, to what
end?

and would it be feasible/beneficial to bypass caching for local resources?

Thanks.
--
Regards
Shridhar
Vishnu V. Krishnan
2018-09-07 15:22:15 UTC
Permalink
I'd like to know too. I use KMail with a local MailDir.
Post by Shridhar Daithankar
Hello,
I was wondering if akonadi caches local resources as well? If yes, to what
end?
and would it be feasible/beneficial to bypass caching for local resources?
Thanks.
Anders Lund
2018-09-07 15:30:47 UTC
Permalink
Post by Shridhar Daithankar
Hello,
I was wondering if akonadi caches local resources as well? If yes, to what
end?
I believe it does
Post by Shridhar Daithankar
and would it be feasible/beneficial to bypass caching for local resources?
Why? Disk space is not so expensive, and akonadi resources also provides lots
of benefits, such as monitoring changes and providing uniform access. Since
kmail bases access to mails on akonadi, I believe it is completely out of
question in any case.

Kindly,
Anders
Post by Shridhar Daithankar
Thanks.
Shridhar Daithankar
2018-09-07 16:09:00 UTC
Permalink
Post by Anders Lund
Why? Disk space is not so expensive, and akonadi resources also provides
lots of benefits, such as monitoring changes and providing uniform access.
Since kmail bases access to mails on akonadi, I believe it is completely
out of question in any case.
I am asking for disabling the caching, not the akonadi resources.

Unless akonadi resources cannot work without a cache?
--
Regard
Anders Lund
2018-09-07 19:18:47 UTC
Permalink
Post by Shridhar Daithankar
Post by Anders Lund
Why? Disk space is not so expensive, and akonadi resources also provides
lots of benefits, such as monitoring changes and providing uniform access.
Since kmail bases access to mails on akonadi, I believe it is completely
out of question in any case.
I am asking for disabling the caching, not the akonadi resources.
Unless akonadi resources cannot work without a cache?
AFAIK akonadi keeps track of metadata (such the headers nessecary), not the
mail bodies.
Shridhar Daithankar
2018-09-08 01:43:43 UTC
Permalink
Post by Anders Lund
Post by Shridhar Daithankar
Post by Anders Lund
Why? Disk space is not so expensive, and akonadi resources also provides
lots of benefits, such as monitoring changes and providing uniform access.
Since kmail bases access to mails on akonadi, I believe it is completely
out of question in any case.
I am asking for disabling the caching, not the akonadi resources.
Unless akonadi resources cannot work without a cache?
AFAIK akonadi keeps track of metadata (such the headers nessecary), not the
mail bodies.
Which is ok, but this data does not need to be cached. It can be fetched
everytime.

The reason I am asking is, if feasible, I would like to file a feature request
where akonadi caching can be disabled for local resources and can optionally
be disabled for other resources.

The later case applies where I run a local IMAP server.

This will save space and processing as detailed in another message in the
thread.

More importantly, I hope to get rid of several short-lived annoying data
behehaviours of akonadi. There are too many of them to report and not all of
them have reproduction, making the overall experience annoying enough.

If for nothing else, whenever somebody reports a problem and if it can be
fixed by disabling caching, the devs can know which layer to look into. This
could help in further debugging the problem.

And for the resources that benefit from caching, what is the procedure to
resync the cache?

Thanks.
--
Regards
Shridhar
Ingo Klöcker
2018-09-08 18:31:09 UTC
Permalink
Post by Shridhar Daithankar
Post by Anders Lund
Post by Shridhar Daithankar
Post by Anders Lund
Why? Disk space is not so expensive, and akonadi resources also provides
lots of benefits, such as monitoring changes and providing uniform access.
Since kmail bases access to mails on akonadi, I believe it is completely
out of question in any case.
I am asking for disabling the caching, not the akonadi resources.
Unless akonadi resources cannot work without a cache?
AFAIK akonadi keeps track of metadata (such the headers nessecary), not
the mail bodies.
Akonadi also stores mail bodies below a certain threshold (I think the default
is 4 KiB; this value can be configured in the database configuration file;
this is a global setting, i.e. it applies to all resources) in the database.
I'm not sure whether it also stores copies of larger mails outside of the
database in its cache. The latter wouldn't be sensible for local resources.
Post by Shridhar Daithankar
Which is ok, but this data does not need to be cached. It can be fetched
everytime.
No. Akonadi caches headers that are necessary for displaying the list of
messages in a folder. If this data wouldn't be cached then Akonadi would have
to read all of the mails in a folder whenever you open this folder. Even with
an SSD this would be magnitudes slower than reading the same data from a
database table.
Post by Shridhar Daithankar
The reason I am asking is, if feasible, I would like to file a feature
request where akonadi caching can be disabled for local resources and can
optionally be disabled for other resources.
It may be possible to reduce the amount of data that is cached. So, please
file a feature request. The worst that can happen is that the Akonadi
developers close it, if they think, it's not feasible.
Post by Shridhar Daithankar
The later case applies where I run a local IMAP server.
This should be possible. Currently, Akonadi caches at least the most recent
messages for IMAP resources.
Post by Shridhar Daithankar
This will save space and processing as detailed in another message in the
thread.
More importantly, I hope to get rid of several short-lived annoying data
behehaviours of akonadi. There are too many of them to report and not all of
them have reproduction, making the overall experience annoying enough.
If for nothing else, whenever somebody reports a problem and if it can be
fixed by disabling caching, the devs can know which layer to look into. This
could help in further debugging the problem.
And for the resources that benefit from caching, what is the procedure to
resync the cache?
There may be other possibilities (I didn't see anything obvious in
akonadiconsole, but maybe akonadictl has something), but, if you did not set
lots of special settings for the folders (e.g. mail filters, identities,
expiration or archiving options, etc.), then the easiest procedure is removing
and re-adding the resource.


Regards,
Ingo
René J.V. Bertin
2018-09-08 19:35:59 UTC
Permalink
Post by Ingo Klöcker
to read all of the mails in a folder whenever you open this folder. Even with
an SSD this would be magnitudes slower than reading the same data from a
database table.
I'm pretty certain that's exactly what Claws does (or used to do, I haven't look at its particulars for a while).
Yet it was anything but orders of magnitude slower than KMail.

R.
Shridhar Daithankar
2018-10-02 13:12:23 UTC
Permalink
Post by Ingo Klöcker
Post by Shridhar Daithankar
The reason I am asking is, if feasible, I would like to file a feature
request where akonadi caching can be disabled for local resources and can
optionally be disabled for other resources.
It may be possible to reduce the amount of data that is cached. So, please
file a feature request. The worst that can happen is that the Akonadi
developers close it, if they think, it's not feasible.
It took a while to get around this, but here it is.

https://bugs.kde.org/show_bug.cgi?id=399306
--
Regards
Shridhar
René J.V. Bertin
2018-09-07 16:36:53 UTC
Permalink
Post by Anders Lund
Why? Disk space is not so expensive, and akonadi resources also provides lots
Maybe, but full is full, and there are systems where you cannot easily add additional (internal) space or even replace the internal disk with something bigger.

Lives can be cheap too but would you waste them? ;) Seriously, I agree that it's not a good approach to copy potentially huge amount of local data lightly just because "disk is cheap".
The IMAP agent has an option to retrieve message bodies on command only and discard that data after a selectable amount of time. For local data that option should be the default and the duration could be (almost) 0 because of the negligible cost of fetching a new copy.
Post by Anders Lund
of benefits, such as monitoring changes
How does monitoring change require caching? How then does the caching algorithm know there's something new to cache? (remember the homunculus? ;) )

R.
Loading...