[Kolab-devel] Expiring Kolab objects cache in Roundcube
Thomas Brüderli
bruederli at kolabsys.com
Thu Aug 16 10:25:12 CEST 2012
Jeroen van Meeuwen wrote:
> On Saturday, June 09, 2012 02:39:04 PM Thomas Brüderli wrote:
>> Hello
>
> Hi Thomas,
>
>> The new storage layer for Kolab 3.0 in Roundcube slowly grows up and it
>> also provides caching of Kolab objects in the local (My)SQL database. The
>> cache is persistent and synchronized with the IMAP mailbox on every access.
>> This means that all objects of each resource every accessed through the web
>> client have a copy in the local cache. You can easily imagine the growth of
>> that cache. So we need some strategy how to expire and remove cache objects
>> in a way that keeps good balance between access speed and storage volume.
>> Here are a few thoughts how that might be achieved:
>
>> 1) Clear user's cache when a user terminates a session
>> 2) Cronjob which removes cache objects older than T - <cache-lifetime>
>> 3) Same as 2) but triggered randomly on web client requests (no cronjob)
>
> [...]
>
>> I'd therefore propose either 2) or 3). [...]
>
> Concerning user mutations (change of primary unique ID / result
> attribute used as identifier in Roundcube, currently the first 'mail'
> attribute value, or user deletion), I'm already in the progress of
> building a Roundcube plugin to the Kolab daemon, that can hook itself up
> to the database and make those changes.
>
> It'd be easiest if we were able to develop a command-line script that
> can synchronize cache* table entries with what exists in the users table
> at that moment, so that the daemon can restrict itself to a limited
> number of columns to update in the users table, and a simple delete on
> the users table.
Such a command line script is now available in
plugins/libkolab/bin/modcache.sh. It accepts different commands such as
'expunge', 'clear' or 'prewarm'.
Since caches are shared amongst users who shared some their folders,
there's no simple SQL query to remove caches of a deleted user. The use
of this dedicated script is recommended in such cases.
For clearing a deleted user's cache, call it as follows:
modcache.sh -h <kolab-host> clear <username>
>
> I think this might both help in pre-seeding caches for a user's (large)
> folders, as well as expiring cache* table entries.
For pre-seeding the cache of a specific user, call it as follows:
modcache.sh -h <host> -u <auth-user> -t <object-type> prewarm <username>
In order to avoid interactive password prompts, add -p <password> to the
command.
The script hasn't been tested or used in production yet so please report
bugs and enhancement requests to bugzilla.
Cheers,
Thomas
More information about the devel
mailing list