[Ovirt-devel] [PATCH] Update search index every half hour.
Scott Seago
sseago at redhat.com
Wed Jan 21 21:09:13 UTC 2009
Daniel P. Berrange wrote:
> On Wed, Jan 21, 2009 at 07:24:27PM +0000, Scott Seago wrote:
>
>> Sets up a cron job to update the search index every half hour.
>> With this in place it will be at most 30 minutes after new/
>> updated content is generated before it will show up in search results.
>>
>
> 30 minutes seems like quite a long time. Is there much CPU overhead
> from updating the search index ? If not I think it'd be nicer to
> do it every 5 minutes or more frequently still. Shame it can't be
> done "on demand" really - eg triggered when an indexable table is
> updated - albeit it with a small delay, so if multiple updates arrive
> in a short time it can coalleasce into one index update.
>
> Daniel
>
30 minutes was totally arbitrary. Overhead would depend mostly on how
much content we've got -- and for now, we don't have a huge quantity --
just rows for VMs, storage volumes, hosts, and pools. 5 minutes is
probably fine -- in any case, there's probably not much point in going
longer than 5 minutes unless we have to.
Search index updates are triggered from outside the DB, so there isn't a
direct way of doing an on-demand update, although you could probably
simulate this with a daemon of some sort. There's already a db table
that gets rows added for objects that need to be updated. Index updates
(rather than the reindex operation) only work on objects with an update
-- so we could have a daemon that polled this table and forked a process
to do the update after it observed a new row added to this table -- but
with no new rows added after a set period of time.
On my dev server it takes about 3 seconds to run the update index rake
task when there's nothing to update -- so even running this task every
minute might not have much of an impact on performance.
Scott
More information about the ovirt-devel
mailing list