Sysbench merupakan tool yang dapat digunakan untuk benchmarking. Untuk instalasi di Freebsd bisa dilakukan via port ataupun package.

# cd /usr/ports/benchmarks/sysbench

# make install clean

# rehash

Setelah terinstall kita bisa mulai mencoba2 melakukan testing.

Misalkan untuk melakukan benchmark pada cpu kita bs melakukan perintah :

# sysbench --test=cpu --cpu-max-prime=20000 run

Untuk melakukan Benchmark Mysql, langkahnya sbb :

1. Siapakan database dan table untuk benchmark. Pastikan user dan passwd mysql anda benar

# sysbench –test=oltp –mysql-table-engine=myisam –oltp-table-size=500000 –mysql-user=usernya –mysql-password=passwdnya –mysql-host=localhost –mysql-db=benchmark –mysql-socket=/tmp/mysql.sock prepare

2. Untuk test performa read pada mysql gunakan perintah :

# sysbench –num-threads=16 –max-requests=100000 –test=oltp –oltp-table-size=500000 –mysql-socket=/tmp/mysql.sock –oltp-read-only –mysql-user=usernya –mysql-password=passwdnya –mysql-db=benchmark run

3. Untuk test performa read dan write pada mysql gunakan perintah :

# sysbench –num-threads=16 –max-requests=10000 –test=oltp –oltp-table-size=500000 –mysql-socket=/tmp/mysql.sock –oltp-test-mode=complex –mysql-user=usernya –mysql-password=passwdnya  –mysql-db=benchmark run

Hasilnya terlihat sbb :

OLTP test statistics:
    queries performed:
        read:                            28003808
        write:                           8000763
        other:                           4000295
        total:                           40004866
    transactions:                        2000023 (341.16 per sec.)
    deadlocks:                           249    (0.04 per sec.)
    read/write requests:                 36004571 (6141.51 per sec.)
    other operations:                    4000295 (682.35 per sec.)

Test execution summary:
    total time:                          5862.4972s
    total number of events:              2000023
    total time taken by event execution: 93741.9585
    per-request statistics:
         min:                            0.0052s
         avg:                            0.0469s
         max:                            0.5604s
         approx.  95 percentile:         0.1432s

Threads fairness:
    distribution:                        99.31/99.71
    execution:                           99.31/99.71

Font bold warna biru adalah hal yang perlu di perhatikan dari hasil benchmark.

Happy testing… karena saya juga masih coba2 he.. he..

Dokumentasi lengkap bisa di pelajari di http://sysbench.sourceforge.net/docs/

sumber : http://blog.uin-malang.ac.id