[Xapian-discuss] how can i reduce cpu usage

Olly Betts olly at survex.com
Thu Sep 3 03:38:25 BST 2009


On Thu, Sep 03, 2009 at 09:12:14AM +0800, ouwind wrote:
> my os is windows. there are a thread used to insert document into
> xapian, i reduce the priority of the thread to below normal, but i
> still get high usage.

A quick google suggests THREAD_PRIORITY_IDLE is what you want there,
rather than just reducing the priority.

High CPU usage is still to be expected, but not to the detriment of
other processes.  So if another process is CPU bound, you'd expect the
indexer to use close to 0%, but if the other processes would only be
using 25% CPU, the indexer would be expected to use up to 75%.

If this really isn't working, I'm not going to be able to help as
Microsoft stuff isn't my area of expertise.  If nobody else on the list
knows, you could try an OS-specific list/forum/irc channel/etc.

If you really want to stick to your original plan, you're going to have
to profile to find where CPU time is actually spent (as I mentioned
before).

Cheers,
    Olly



More information about the Xapian-discuss mailing list