3

I have a program, which adds one byte of data to a file placed on a file server. I would like to know, how many disk seeks this takes, when the file is opened and closed after writing each byte of data?

2 Answers 2

3

It depends on how much data about the file / its path is already cached, the gap between opening the file and appending the byte, the gap between appending the byte and closing the file, and whatever else is using the disk / cache at the same time.

Even if you could find all this out, why would you want to know such a thing? Even in the absence of any other I/O, you don't know how long a seek operation will take - that depends on the speed of the disk, the position of the file on the disk and the position of the head when the disk receives the request.

3
  • Thank you for your answer. By knowing this, I would know the theoretical maximum performance.
    – David
    Jun 9, 2011 at 12:50
  • @david, you are ignoring the fact that mos disk drives now have on board cache- so the theoretical maximum based on disk seeks is a nonsense number
    – Jim B
    Jun 9, 2011 at 14:06
  • If you want to know how it performs for your work pattern the way to get a metric is by measuring the performance for your work pattern
    – symcbean
    Jun 10, 2011 at 12:20
0

under windows, 0 as by default windows will wait until there is no IO (and thus flush the buffer) or the buffer is full. this is controlled per device under write caching policy.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .