--file-fsync-all=[on|off] 每履行完一次写操作就履行一次fsync。默认是off
--file-fsync-end=[on|off] 在测试停止时才履行fsync。默认是on
--file-fsync-mode=STRING 应用哪种办法进行同步{fsync, fdatasync}。默认是fsync
--file-merged-requests=N 如不雅可以,归并最多的IO请求数(0 – 表示不归并)。默认是0
--file-rw-ratio=N 测试时的读写比例。默认是1.5
- root@db2:~# sysbench --test=mutex help
- sysbench 0.4.12: multi-threaded system evaluation benchmark
2):sysbench --test=cpu help
--cpu-max-prime=N 最大年夜质数产生器数量。默认是10000
3):sysbench --test=memory help
- root@db2:~# sysbench --test=memory help
- sysbench 0.4.12: multi-threaded system evaluation benchmark
memory options:
--memory-block-size=SIZE 测试时内存块大年夜小。默认是1K
--memory-total-size=SIZE 传输数据的总大年夜小。默认是100G
--memory-scope=STRING 内存拜访范围{global,local}。默认是global
--memory-hugetlb=[on|off] 大年夜HugeTLB池内存分派。默认是off
--memory-oper=STRING 内存操作类型。{read, write, none} 默认是write
--memory-access-mode=STRING存储器存取方法{seq,rnd} 默认是seq
4):sysbench --test=threads help
sysbench 0.4.12: multi-threaded system evaluation benchmark
这里我们用一个PHP机能分析对象,名叫ifP(instrumentation-for-php),代码托管在Google Code上(https://code.google.com/archi...),该对象可以更好的存眷数据库的调用。所以当无法在数据库层面进行测试的时刻,Ifp可以很好的赞助应用分析数据库的应用率。Ifp是一个供给了计数器和急鹞鲼的单例类,很轻易安排到临盆情况中,因为不须要拜访PHP的设备权限(因为对于很多开辟人员来说,都没有拜访PHP的设备的权限。)
threads options:
--thread-yields=N 每个请求产生若干个线程。默认是1000
--thread-locks=N 每个线程的锁的数量。默认是8
5):sysbench --test=mutex help
--db-driver=STRING 指定命据库驱动法度榜样('help' to get list of available drivers)
--oltp-dist-pct=N 值的百分比被视为'special' (for special distribution)。默认是1
mutex options:
--mutex-num=N 数组互斥的总大年夜小。默认是4096
--mutex-locks=N 每个线程互斥锁的数量。默认是50000
--mutex-loops=N 内部互斥锁的空轮回数量。默认是10000
6): sysbench --test=oltp help
- root@db2:~# sysbench --test=oltp help
- sysbench 0.4.12: multi-threaded system evaluation benchmark
oltp options:
--oltp-test-mode=STRING 履行模式{simple,complex(advanced transactional),nontrx(non-transactional),sp}。默认是complex
--oltp-reconnect-mode=STRING 从新连接模式{session(不应用从新连接。每个线程断开只在测试停止),transaction(在每次事务停止后从新连接),query(在每个SQL语句履行完从新连接),random(对于每个事务随机选择以上从新连接模式)}。默认是session
--oltp-read-only=[on|off] 只读模式。Update,delete,insert语句弗成履行。默认是off
--oltp-skip-trx=[on|off] 省略begin/commit语句。默认是off
- sudo apt-get install mysql-server mysql-client
--oltp-range-size=N 萌芽范围。默认是100
--oltp-order-ranges=N number of ordered ranges [1]
--oltp-point-selects=N number of point selects [10]
--oltp-simple-ranges=N number of simple ranges [1]
--oltp-sum-ranges=N number of sum ranges [1]
--oltp-distinct-ranges=N number of distinct ranges [1]
--oltp-non-index-updates=N number of non-index updates [1]
--oltp-nontrx-mode=STRING 萌芽类型对于非事务履行模式{select, update_key, update_nokey, insert, delete} [select]
--oltp-auto-inc=[on|off] AUTO_INCREMENT是否开启。默认是on
--oltp-connect-delay=N 在若干微秒后连接数据库。默认是10000
2,run阶段
--mysql-create-options=STRING additional options passed to CREATE TABLE []
--oltp-user-delay-min=N 每个请求最短等待时光。单位是ms。默认是0
--oltp-user-delay-max=N 每个请求最长等待时光。单位是ms。默认是0
--oltp-table-name=STRING 测试时应用到的表名。默认是sbtest
- sysbench --test=fileio --num-threads=20 --file-total-size=2G --file-test-mode=rndrw run
--oltp-table-size=N 测试表的记录数。默认是10000
推荐阅读
室外持续高温,王金升正舒畅地在空调房享受着这一消暑时刻,忽然他放在桌子上的手机“滴滴”地响了起来,他经由过程简单的操作,就完成了自家地里的举措措施大年夜棚的┞菲握。>>>详细阅读
本文标题:MySQL高性能学习笔记
地址:http://www.17bianji.com/lsqh/36585.html
1/2 1