Sysbench²ÎÊýÖÐÎĽâÊÍ
# sysbench ²âÊÔÓÃÀý: sysbench [general-options]¡ ¨Ctest=[test-options]¡ command ͨÓÃÑ¡Ïî: --num-threads=N ´´½¨²âÊÔÏ̵߳ÄÊýÄ¿¡£Ä¬ÈÏΪ1. --max-requests=N ÇëÇóµÄ×î´óÊýÄ¿¡£Ä¬ÈÏΪ10000£¬0´ú±í²»ÏÞÖÆ¡£ --max-time=N ×î´óÖ´ÐÐʱ¼ä£¬µ¥Î»ÊÇs¡£Ä¬ÈÏÊÇ0,²»ÏÞÖÆ¡£ --forced-shutdown=STRING ³¬¹ýmax-timeÇ¿ÖÆÖжϡ£Ä¬ÈÏÊÇoff¡£ --thread-stack-size=SIZE ÿ¸öÏ̵߳ĶÑÕ»´óС¡£Ä¬ÈÏÊÇ32K¡£ --init-rng=[on|off] ÔÚ²âÊÔ¿ªÊ¼Ê±ÊÇ·ñ³õʼ»¯Ëæ»úÊý·¢ÉúÆ÷¡£Ä¬ÈÏÊÇoff¡£ --test=STRING Ö¸¶¨²âÊÔÏîÄ¿Ãû³Æ¡£ --debug=[on|off] ÊÇ·ñÏÔʾ¸ü¶àµÄµ÷ÊÔÐÅÏ¢¡£Ä¬ÈÏÊÇoff¡£ --validate=[on|off] ÔÚ¿ÉÄÜÇé¿öÏÂÖ´ÐÐÑéÖ¤¼ì²é¡£Ä¬ÈÏÊÇoff¡£ ²âÊÔÏîÄ¿: fileio ¨C File I/O test cpu ¨C CPU performance test memory ¨C Memory functions speed test threads ¨C Threads subsystem performance test mutex ¨C Mutex performance test(»¥³âÐÔÄܲâÊÔ) oltp ¨C OLTP test (Áª»úÊÂÎñ´¦Àíϵͳ) Ö¸Áî: prepare(²âÊÔǰ׼±¸¹¤×÷) run(Õýʽ²âÊÔ) cleanup(²âÊÔºóɾµô²âÊÔÊý¾Ý) help version See ¡®sysbench ¨Ctest= help¡¯ for a list of options for each test. ²é¿´Ã¿¸ö²âÊÔÏîÄ¿µÄ¸ü¶àÑ¡ÏîÁÐ±í¡£ # ./sysbench ¨Ctest=fileio help --file-num=N ´´½¨²âÊÔÎļþµÄÊýÁ¿¡£Ä¬ÈÏÊÇ128 --file-block-size=N ²âÊÔʱÎļþ¿éµÄ´óС¡£Ä¬ÈÏÊÇ16384(16K) --file-total-size=SIZE ²âÊÔÎļþµÄ×Ü´óС¡£Ä¬ÈÏÊÇ2G --file-test-mode=STRING Îļþ²âÊÔģʽ{seqwr(˳Ðòд), seqrewr(˳Ðò¶Áд), seqrd(˳Ðò¶Á), rndrd(Ëæ»ú¶Á), rndwr(Ëæ»úд), rndrw(Ëæ»ú¶Áд)} --file-io-mode=STRING Îļþ²Ù×÷ģʽ{sync(ͬ²½),async(Òì²½),fastmmap(¿ìËÙmapÓ³Éä),slowmmap(ÂýmapÓ³Éä)}¡£Ä¬ÈÏÊÇsync --file-extra-flags=STRING ʹÓöîÍâµÄ±êÖ¾À´´ò¿ªÎļþ{sync,dsync,direct} ¡£Ä¬ÈÏΪ¿Õ --file-fsync-freq=N Ö´ÐÐfsync()µÄƵÂÊ¡£(0¨C²»Ê¹ÓÃfsync())¡£Ä¬ÈÏÊÇ100 --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¨C±íʾ²»ºÏ²¢)¡£Ä¬ÈÏÊÇ0 --file-rw-ratio=N ²âÊÔʱµÄ¶Áд±ÈÀý¡£Ä¬ÈÏÊÇ1.5 # sysbench --test=cpu help --cpu-max-prime=N ×î´óÖÊÊý·¢ÉúÆ÷ÊýÁ¿¡£Ä¬ÈÏÊÇ10000 # sysbench --test=memory help --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 # sysbench --test=threads help --thread-yields=N ÿ¸öÇëÇó²úÉú¶àÉÙ¸öÏ̡߳£Ä¬ÈÏÊÇ1000 --thread-locks=N ÿ¸öÏ̵߳ÄËøµÄÊýÁ¿¡£Ä¬ÈÏÊÇ8 # sysbench --test=mutex help --mutex-num=N Êý×黥³âµÄ×Ü´óС¡£Ä¬ÈÏÊÇ4096 --mutex-locks=N ÿ¸öÏ̻߳¥³âËøµÄÊýÁ¿¡£Ä¬ÈÏÊÇ50000 --mutex-loops=N ÄÚ²¿»¥³âËøµÄ¿ÕÑ»·ÊýÁ¿¡£Ä¬ÈÏÊÇ10000 # sysbench --test=oltp help 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-sp-name=STRING ´æ´¢¹ý³ÌµÄÃû³Æ¡£Ä¬ÈÏΪ¿Õ --oltp-read-only=[on|off] Ö»¶Áģʽ¡£Update£¬delete£¬insertÓï¾ä²»¿ÉÖ´ÐС£Ä¬ÈÏÊÇoff --oltp-skip-trx=[on|off] Ê¡ÂÔbegin/commitÓï¾ä¡£Ä¬ÈÏÊÇoff --oltp-range-size=N ²éѯ·¶Î§¡£Ä¬ÈÏÊÇ100 --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-order-ranges=N number of ordered ranges [1] --oltp-distinct-ranges=N number of distinct ranges [1] --oltp-index-updates=N number of index update [1] --oltp-non-index-updates=N number of non-index updates [1] --oltp-nontrx-mode=STRING ²éѯÀàÐͶÔÓÚ·ÇÊÂÎñÖ´ÐÐģʽ{select, update_key, update_nokey, insert, delete} [selec