Programming/OS, Program, Framework Tip

sysbench - 리눅스 시스템/DB 성능 테스트 (ODROID XU4 성능)

awesometic 2017. 10. 25. 12:20
반응형

개요

간단한 리눅스 성능 테스트 방법입니다. CLI 환경에서 sysbench를 이용하기 때문에, 서버 성능 평가를 위해 많이 사용된다고 하네요.


sysbench

sysbench 를 설치하고,

sudo apt install sysbench

많은 임시 파일들이 생성되기 때문에 임시 디렉토리도 만듭니다.

mkdir sysbench_temp
cd sysbench_temp

sysbench 로 크게 4가지 성능 테스트를 진행하실 수 있습니다. --num-threads 옵션에 자신의 CPU에 맞는 쓰레드 수를 넣어주세요.

예제 테스트 환경: Ubuntu Minimal 16.04.3 LTS, 4.9.58-70, eMMC 32G. 참고삼아 봐주세요.

##### CPU #####
sysbench --test=cpu --cpu-max-prime=20000 --num-threads=1 run

# results (--num-threads=8 for ODROID-XU4)
sysbench 0.4.12:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 8

Doing CPU performance benchmark

Threads started!
Done.

Maximum prime number checked in CPU test: 20000


Test execution summary:
    total time:                          38.0050s
    total number of events:              10000
    total time taken by event execution: 303.9039
    per-request statistics:
         min:                                 23.16ms
         avg:                                 30.39ms
         max:                                204.86ms
         approx.  95 percentile:              40.97ms

Threads fairness:
    events (avg/stddev):           1250.0000/364.37
    execution time (avg/stddev):   37.9880/0.01
##### Memory #####
# Read
sysbench --test=memory --memory-block-size=1K --memory-scope=global --memory-total-size=10G --memory-oper=read --num-threads=1 run

# Write
sysbench --test=memory --memory-block-size=1K --memory-scope=global --memory-total-size=10G --memory-oper=write --num-threads=1 run

# results (--num-threads=8 for ODROID-XU4)
# Read
sysbench 0.4.12:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 8

Doing memory operations speed test
Memory block size: 1K

Memory transfer size: 2048M

Memory operations type: read
Memory scope type: global
Threads started!
Done.

Operations performed: 2097152 (349996.65 ops/sec)

2048.00 MB transferred (341.79 MB/sec)


Test execution summary:
    total time:                          5.9919s
    total number of events:              2097152
    total time taken by event execution: 31.9403
    per-request statistics:
         min:                                  0.00ms
         avg:                                  0.02ms
         max:                                  7.87ms
         approx.  95 percentile:               0.00ms

Threads fairness:
    events (avg/stddev):           262144.0000/1303.51
    execution time (avg/stddev):   3.9925/0.01

# Write
sysbench 0.4.12:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 8

Doing memory operations speed test
Memory block size: 1K

Memory transfer size: 2048M

Memory operations type: write
Memory scope type: global
Threads started!
Done.

Operations performed: 2097152 (360345.34 ops/sec)

2048.00 MB transferred (351.90 MB/sec)


Test execution summary:
    total time:                          5.8198s
    total number of events:              2097152
    total time taken by event execution: 31.2525
    per-request statistics:
         min:                                  0.00ms
         avg:                                  0.01ms
         max:                                  7.66ms
         approx.  95 percentile:               0.00ms

Threads fairness:
    events (avg/stddev):           262144.0000/1225.37
    execution time (avg/stddev):   3.9066/0.01
##### Storage #####
# --file-total-size 를 램 용량보다 크게 해주세요.
sysbench --test=fileio --file-total-size=4G prepare
sysbench --test=fileio --file-total-size=4G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 --num-threads=1 run
sysbench --test=fileio --file-total-size=4G cleanup

# results (--num-threads=8 for ODROID-XU4)
sysbench 0.4.12:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 8
Initializing random number generator from timer.


Extra file open flags: 0
128 files, 32Mb each
4Gb total file size
Block size 16Kb
Number of random requests for random IO: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Threads started!
Time limit exceeded, exiting...
(last message repeated 7 times)
Done.

Operations performed:  348970 Read, 232645 Write, 743585 Other = 1325200 Total
Read 5.3249Gb  Written 3.5499Gb  Total transferred 8.8747Gb  (30.292Mb/sec)
 1938.67 Requests/sec executed

Test execution summary:
    total time:                          300.0072s
    total number of events:              581615
    total time taken by event execution: 673.5174
    per-request statistics:
         min:                                  0.01ms
         avg:                                  1.16ms
         max:                                228.79ms
         approx.  95 percentile:               2.38ms

Threads fairness:
    events (avg/stddev):           72701.8750/937.95
    execution time (avg/stddev):   84.1897/1.00
##### MySQL/MariaDB #####
# test 라는 이름의 데이터베이스가 미리 MySQL에 등록되어 있어야 합니다.
sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=your-password prepare
sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=your-password --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=1 run
sysbench --test=oltp --mysql-db=test --mysql-user=root --mysql-password=your-password cleanup

# results (--num-threads=8 for ODROID-XU4)
sysbench 0.4.12:  multi-threaded system evaluation benchmark

No DB drivers specified, using mysql
Running the test with following options:
Number of threads: 8

Doing OLTP test.
Running mixed OLTP test
Doing read-only test
Using Special distribution (12 iterations,  1 pct of values are returned in 75 pct cases)
Using "BEGIN" for starting transactions
Using auto_inc on the id column
Threads started!
Time limit exceeded, exiting...
(last message repeated 7 times)
Done.

OLTP test statistics:
    queries performed:
        read:                            346220
        write:                           0
        other:                           49460
        total:                           395680
    transactions:                        24730  (412.08 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 346220 (5769.14 per sec.)
    other operations:                    49460  (824.16 per sec.)

Test execution summary:
    total time:                          60.0124s
    total number of events:              24730
    total time taken by event execution: 479.3402
    per-request statistics:
         min:                                  8.19ms
         avg:                                 19.38ms
         max:                                 37.71ms
         approx.  95 percentile:              24.70ms

Threads fairness:
    events (avg/stddev):           3091.2500/53.37
    execution time (avg/stddev):   59.9175/0.01

참고


반응형