Share

System performance benchmark

Subscribe

read and write in memory program

  1. 2009-09-19 17:07:36 UTC

    hi,

    I would like to ask what can cause the difference of the result of "read" and "write" operation in global and sequential mode of "memory" benchmark in SysBench.

    I have tried several "memory-block-size" and I realize that "read" operation is quicker than "write". Is this result coming from the effect of data prefetching of cache? or coming from the restriction of write buffer? or what else can cause?

    I show one example in read and write below. read is twice quicker than write there. I use intel core 2 duo and fedora 7.

    read operation

    $ sysbench --num-threads=100 --test=memory --memory-block-size=8M --memory-scope=global --memory-total-size=50G --memory-oper=read run
    
    sysbench v0.4.8:  multi-threaded system evaluation benchmark
    
    Running the test with following options:
    
    Number of threads: 100
    
    Doing memory operations speed test
    
    Memory block size: 8192K
    
    Memory transfer size: 51200M
    
    Memory operations type: read
    
    Memory scope type: global
    
    Threads started!
    
    Done.
    
    Operations performed: 6400 (  255.66 ops/sec)
    
    51200.00 MB transferred (2045.30 MB/sec)
    
    
    Test execution summary:
    
    total time:                          25.0330 s
    
    total number of events:              6400
    
    total time taken by event execution: 64.4097
    
    per-request statistics:
    
         min:                            0.0073s
    
         avg:                            0.0101s
    
         max:                            0.6164s
    
         approx.  95 percentile:         0.0077s
    
    Threads fairness:
    
    events (avg/stddev):           64.0000/0.63
    
    execution time (avg/stddev):   0.6441/0.31
    

    write operation

    $ sysbench --num-threads=100 --test=memory --memory-block-size=8M --memory-scope=global --memory-total-size=50G --memory-oper=write run
    
    sysbench v0.4.8:  multi-threaded system evaluation benchmark
    
    Running the test with following options:
    
    Number of threads: 100
    
    Doing memory operations speed test
    
    Memory block size: 8192K
    
    Memory transfer size: 51200M
    
    Memory operations type: write
    
    Memory scope type: global
    
    Threads started!
    
    Done.
    
    Operations performed: 6400 (  120.93 ops/sec)
    
    51200.00 MB transferred (967.47 MB/sec)
    
    
    Test execution summary:
    
    total time:                          52.9216 s
    
    total number of events:              6400
    
    total time taken by event execution: 2886.7675
    
    per-request statistics:
    
         min:                            0.0100s
    
         avg:                            0.4511s
    
         max:                            1.4056s
    
         approx.  95 percentile:         0.8500s
    
    Threads fairness:
    
    events (avg/stddev):           64.0000/2.04
    
    execution time (avg/stddev):   28.8677/0.99
    
  2. 2009-09-21 07:41:21 UTC

    Hi,

    The main reason for the difference you are observing is that with --memory-block-size=8M in the sequential read test you are essentially benchmarking the L2 cache read performance. The write speed is significantly lower due to cache line invalidations, especially on a multi-threaded test.

  3. 2009-09-23 16:50:35 UTC

    >kaamos

    Thanks for your help.

    I see the large increase of STORE_BLOCK.ORDER in write. read: 1915707 write: 14171958024

    may be related to cache line invalidations ?

< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.