[Xapian-discuss] how can i reduce cpu usage

ouwind ouwind at 163.com
Thu Sep 3 02:12:14 BST 2009


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.
On Wed, Sep 02, 2009 at 12:10:12PM +0100, Olly Betts wrote:
> Why not work with the facilities the OS provides?
> 
> If this is Unix, then use "nice -n19" to tell the scheduler to give
> least priority to the indexing process.  Then other processes will get
> all the CPU time they want, and the indexer will use as much of the
> remaining CPU time as it wants.

Recent Linux (>= 2.6.23) also has "chrt --idle".  I've not compared, but
it's probably slightly more effective at achieving the above.

> If you have a recent Linux version, "ionice -c3" can do similar things
> for I/O prioritising.

Cheers,
    Olly
     




More information about the Xapian-discuss mailing list