We already have written blog on Sysbench (https:\/\/minervadb.com\/index.php\/2018\/03\/13\/benchmarking-mysql-using-sysbench-1-1\/<\/a><\/span>) , so in this blog we are not covering basic details like installation and configuration of Sysbench. In this blog we are just specific on benchmarking CPU, Memory, file I\/O and mutex performance :<\/p>\n Benchmarking CPU using Sysbench<\/strong><\/p>\n This benchmark is configured with the number of simultaneous threads and the maximum number to verify if it is a prime.<\/p>\n To conclude the interpretation of thread performance benchmarking, we annotate time elapsed (actual time for the completion of the activity), in this case it “60.0003” seconds.<\/p>\n<\/div>\n <\/p>\n The throughput and average latency are the two matrices we consider to interpret mutex workload performance :<\/p>\n <\/p>\n Benchmarking the memory workload\u00a0<\/strong><\/p>\n When we use sysbench to benchmark memory, sysbench allocate a memory buffer and then read or write from\/on it, each time for the size of a pointer (32 bit or 64 bit) and until the total buffer size has been read from or written to. \u00a0This activity will be continued till the provided volume (–memory-total-size) is reached. The load can be increased or reduced by providing multiple threads (–num-threads), size of buffer (–memory-block-size) and request type (read \/ write \/ sequential \/ random)<\/p>\n Throughput and operations per second are the important matrices to measure for memory workload benchmarking :<\/p>\n You can use multiple scenarios for benchmarking file system I\/O but here we have used rndrw \u00a0(combined random read \/ write) for more complex I\/O and production similar I\/O operations, This happens in three steps explained below:<\/p>\n Prepare\u00a0<\/em><\/p>\n Run<\/em><\/p>\n Cleanup\u00a0<\/em><\/p>\n In the file system I\/O benchmarking, We spend time annotating and interpreting only throughput (both reads and writes) under varying loads, Here in the test above read throughput is 40.89 MB\/s and the write throughput is 27.26 MB\/s<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":" We already have written blog on Sysbench (https:\/\/minervadb.com\/index.php\/2018\/03\/13\/benchmarking-mysql-using-sysbench-1-1\/) , so in this blog we are not covering basic details like installation and configuration of Sysbench. In this blog we are just specific on benchmarking CPU, […]<\/a><\/p>\n<\/div>","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,15,56,104,103],"tags":[5,105,106],"yoast_head":"\n[root@localhost shiv]# sysbench --test=cpu --cpu-max-prime=2000000 --num-threads=120 run<\/pre>\n
Running the test with following options:\r\nNumber of threads: 120\r\nInitializing random number generator from current time\r\n\r\n\r\nPrime numbers limit: 2000000\r\n\r\nInitializing worker threads...\r\n\r\nThreads started!\r\n\r\nCPU speed:\r\n events per second: 0.69\r\n\r\nThroughput:\r\n events\/s (eps): 0.6891\r\n time elapsed: 174.1418s\r\n total number of events: 120\r\n\r\nLatency (ms):\r\n min: 169807.71\r\n avg: 172640.02\r\n max: 174120.65\r\n 95th percentile: 100000.00\r\n sum: 20716802.25\r\n\r\nThreads fairness:\r\n events (avg\/stddev): 1.0000\/0.00\r\n execution time (avg\/stddev): 172.6400\/0.83\r\n<\/pre>\n
[root@localhost shiv]# sysbench --test=threads --thread-locks=10 --max-time=60 run\r\n\r\nsysbench 1.1.0-651e7fd (using bundled LuaJIT 2.1.0-beta3)\r\n\r\nRunning the test with following options:\r\nNumber of threads: 1\r\nInitializing random number generator from current time\r\n\r\n\r\nInitializing worker threads...\r\n\r\nThreads started!\r\n\r\n\r\nThroughput:\r\n events\/s (eps): 2366.0725\r\n time elapsed: 60.0003s\r\n total number of events: 141965\r\n\r\nLatency (ms):\r\n min: 0.38\r\n avg: 0.42\r\n max: 8.86\r\n 95th percentile: 0.53\r\n sum: 59942.51\r\n\r\nThreads fairness:\r\n events (avg\/stddev): 141965.0000\/0.00\r\n execution time (avg\/stddev): 59.9425\/0.00\r\n<\/pre>\n
[root@localhost shiv]# sysbench --test=mutex --num-threads=130 run\r\nWARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.\r\nWARNING: --num-threads is deprecated, use --threads instead\r\nsysbench 1.1.0-651e7fd (using bundled LuaJIT 2.1.0-beta3)\r\n\r\nRunning the test with following options:\r\nNumber of threads: 130\r\nInitializing random number generator from current time\r\n\r\n\r\nInitializing worker threads...\r\n\r\nThreads started!\r\n\r\n\r\nThroughput:\r\n events\/s (eps): 5.8047\r\n time elapsed: 22.3956s\r\n total number of events: 130\r\n\r\nLatency (ms):\r\n min: 17566.82\r\n avg: 20789.93\r\n max: 22230.90\r\n 95th percentile: 21641.55\r\n sum: 2702690.46\r\n\r\nThreads fairness:\r\n events (avg\/stddev): 1.0000\/0.00\r\n execution time (avg\/stddev): 20.7899\/0.82\r\n<\/pre>\n
Throughput:\r\n events\/s (eps): 5.8047\r\n time elapsed: 22.3956s\r\n\r\nLatency (ms):\r\n min: 17566.82\r\n avg: 20789.93\r\n max: 22230.90\r\n 95th percentile: 21641.55\r\n sum: 2702690.46\r\n<\/pre>\n
[root@localhost shiv]# sysbench --test=memory --num-threads=140 --memory-total-size=10G run\r\n\r\nsysbench 1.1.0-651e7fd (using bundled LuaJIT 2.1.0-beta3)\r\n\r\nRunning the test with following options:\r\nNumber of threads: 140\r\nInitializing random number generator from current time\r\n\r\n\r\nRunning memory speed test with the following options:\r\n block size: 1KiB\r\n total size: 10240MiB\r\n operation: write\r\n scope: global\r\n\r\nInitializing worker threads...\r\n\r\nThreads started!\r\n\r\nTotal operations: 10485720 (3351958.44 per second)\r\n\r\n10239.96 MiB transferred (3273.40 MiB\/sec)\r\n\r\n\r\nThroughput:\r\n events\/s (eps): 3351958.4393\r\n time elapsed: 3.1282s\r\n total number of events: 10485720\r\n\r\nLatency (ms):\r\n min: 0.00\r\n avg: 0.01\r\n max: 2931.98\r\n 95th percentile: 0.00\r\n sum: 123371.54\r\n\r\nThreads fairness:\r\n events (avg\/stddev): 74898.0000\/0.00\r\n execution time (avg\/stddev): 0.8812\/0.93\r\n<\/pre>\n
Total operations: 10485720 (3351958.44 per second)\r\n\r\n10239.96 MiB transferred (3273.40 MiB\/sec)\r\n<\/pre>\n
Benchmarking file system I\/O with Sysbench<\/h3>\n
\n
[root@localhost shiv]# sysbench --num-threads=16 --test=fileio --file-total-size=10G --file-test-mode=rndrw prepare\r\n\r\nsysbench 1.1.0-651e7fd (using bundled LuaJIT 2.1.0-beta3)\r\n\r\n128 files, 81920Kb each, 10240Mb total\r\nCreating files for the test...\r\nExtra file open flags: (none)\r\nReusing existing file test_file.0\r\nReusing existing file test_file.1\r\nReusing existing file test_file.2\r\nReusing existing file test_file.3\r\n..................................\r\n..................................\r\n\r\nReusing existing file test_file.122\r\nReusing existing file test_file.123\r\nReusing existing file test_file.124\r\nReusing existing file test_file.125\r\nReusing existing file test_file.126\r\nReusing existing file test_file.127\r\n<\/pre>\n
[root@localhost shiv]# sysbench --num-threads=16 --test=fileio --file-total-size=10G --file-test-mode=rndrw run\r\n\r\nsysbench 1.1.0-651e7fd (using bundled LuaJIT 2.1.0-beta3)\r\n\r\nRunning the test with following options:\r\nNumber of threads: 16\r\nInitializing random number generator from current time\r\n\r\n\r\nExtra file open flags: (none)\r\n128 files, 80MiB each\r\n10GiB total file size\r\nBlock size 16KiB\r\nNumber of IO requests: 0\r\nRead\/Write ratio for combined random IO test: 1.50\r\nPeriodic FSYNC enabled, calling fsync() each 100 requests.\r\nCalling fsync() at the end of test, Enabled.\r\nUsing synchronous I\/O mode\r\nDoing random r\/w test\r\nInitializing worker threads...\r\n\r\nThreads started!\r\n\r\n\r\nThroughput:\r\n read: IOPS=2495.85 39.00 MiB\/s (40.89 MB\/s)\r\n write: IOPS=1663.70 26.00 MiB\/s (27.26 MB\/s)\r\n fsync: IOPS=5311.68\r\n\r\nLatency (ms):\r\n min: 0.00\r\n avg: 1.69\r\n max: 631.90\r\n 95th percentile: 5.00\r\n sum: 159794.48\r\n<\/pre>\n
[root@localhost shiv]# sysbench --num-threads=16 --test=fileio --file-total-size=10G --file-test-mode=rndrw cleanup \r\nWARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.\r\nWARNING: --num-threads is deprecated, use --threads instead\r\nsysbench 1.1.0-651e7fd (using bundled LuaJIT 2.1.0-beta3)\r\n\r\nRemoving test files...\r\n<\/pre>\n