Question

I have a background thread that performs I/O operations (keeping an index up to date). But in addition to that several clients access the server's hard disk and I want these accesses as fast as possible. So I thought, it would be nice, if the indexing thread is only running when the I/O load is low.

Is there a way to figure this out?

I'm open for alternative suggestions as well.

Was it helpful?

Solution

Use Performance Counters to get the I/O activity of the disks. Once it gets to the low-end of your threshold, allow your threads to run. Don't forget to take into account your own I/O load you'll be adding when deciding what your high-end is for the stopping threshold.

OTHER TIPS

Setting your threads priority to idle should be sufficient.


Edit

You are right about the fact that the thread's priority does not impact the IO priority.
Take a look at I/O Prioritization in Windows Vista for a detailed explanation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top