views:

129

answers:

2

How can I write a program which can test throughput of disk in Windows systems using c++?

What's the mainly steps and APIs that I can use to programming?

A: 

In outline:

  • write a known (large) amount of data to disk ( see write() )
  • start clock (see time() or clock() )
  • read data from disk (see read() )
  • stop clock (see above)
  • report results (see cout)
anon
A: 

One open-source benchmark is bonnie, which mostly uses the standard C API. You'll need to change some of the timing functions to suit Windows.

Pete Kirkham
Hi Pete,"I believe thatmemory is in short supply, so caches max out, thusmany I/O operations end up really doing I/O"what does this sentence mean in the bonnie website?
Jinx
If you have a a 1TB database on a machine with 16GB RAM, what's going to matter is how fast the disk can seek/read rather than how good the OS is at caching, because the caches will get exhausted quickly.
Pete Kirkham