[Tracker] Letting tracker help with garbage collection



Hi,

In qtcontacts-tracker we run a garbage collection query after each
contact save request. Obviously this is not perfect for performance, but
not running that query also is an option since leaving too many abandon
objects in the tracker store also has massively degrades performance
over time.

So what I have in mind now is to count how many contacts were saved and
how much time has passed since last garbage collection was run. The
query only would be executed when either too many contacts were saved
recently, or when no cleanup was performed for quite some time.

Obviously this problem cannot be solved locally in the qtcontacts-
tracker plugin itself: The different processes would have an incomplete
and probably incorrect picture of GC. It's trivial to imagine states
where some processes would trigger that expensive GC right after each
other. It's also trivial to imagine situations where the much needed GC
is not run at all.

So my idea now is to move that GC into a dedicated process which
provides a DBus interface for cooperatively managing GC. I'd prefer
tracker-store to be that process: It already runs and it also has most
efficient access to tracker. Of course if this proposal is rejected,
it's trivial to ship a dedicated binary with qtcontacts-tracker, but I'd
really like to avoid that alternative plan.

So that I hopefully sufficiently explained my goals let's see how my
DBus API would look like. It would consist of two methods:


    org.freedesktop.Tracker1.Resources.RegisterGarbageCollector
                                      (in STRING query_string, 
                                       in UINT32 minimum_load,
                                       in UINT32 maximum_load,
                                       in UINT32 maximum_delay,
                                       out UINT32 collector_id)
    
    org.freedesktop.Tracker1.Resources.TriggerGarbageCollector
                                      (in UINT32 collector_id,
                                       in UINT32 load_increment)


Each invokation of TriggerGarbageCollector() increases the collector's
load, until it finally decides to run. After successful run the load is
reset.

Does this make sense? Will do patches then.

Ciao,
Mathias

-- 
Mathias Hasselmann <mathias openismus com>
http://openismus.com/





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]