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.
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.