开发者

General Knowledge Question: Network Access Time, Cache Access Time, Disk Access Time

I have written a simulator of a client-server based distributed file system. Now to calculate the average block access time, I want the following:

  1. Local Cache Access Time
  2. Client to Client Cache Access Time (same network)
  3. Client to Server Cache Access Time (different Network)
  4. Client to Disk Access Time

Assuming 开发者_运维问答if the block size is 64MB...

Could any one give me approximate times... Links to prove it would be appreciated...

Thanks.


Why don't you simply measure it?

For network, use the ping command to measure latency, and divide 64MB by available bandwith for propagation delay. For files use cat, for main memory, use

public static void main(String[] args) {
    byte[] data = new byte[64*1024*1024];
    long start = System.nanoTime();
    int sum = 0;
    for (byte b : data) {
        sum += b;
    }
    long end = System.nanoTime();
    System.out.println(new BigDecimal(end - start).movePointLeft(9));
}

Which on my machine yields

0.209555405

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜