--file-test-mode: 1. seqwr: sequential write 2. seqrewr: sequential read and write 3. seqrd: sequential read 4. rndrd: random read 5. rndwr: random write 6. *rndrw: random read and write
使用随机读写测试。
1 2 3
for each in 1 4 8 16 32; do sysbench fileio --file-total-size=6G --file-test-mode=rndrw --time=240 --events=0 --file-block-size=4k --file-num=3 --threads=$each run; done
Running the test with following options: Number of threads: 1 Initializing random number generator from current time
Extra file open flags: (none) 3 files, 2GiB each 6GiB total file size Block size 4KiB Number of IO requests: 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 Initializing worker threads...
Running the test with following options: Number of threads: 4 Initializing random number generator from current time
Extra file open flags: (none) 3 files, 2GiB each 6GiB total file size Block size 4KiB Number of IO requests: 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 Initializing worker threads...
Running the test with following options: Number of threads: 8 Initializing random number generator from current time
Extra file open flags: (none) 3 files, 2GiB each 6GiB total file size Block size 4KiB Number of IO requests: 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 Initializing worker threads...
Running the test with following options: Number of threads: 16 Initializing random number generator from current time
Extra file open flags: (none) 3 files, 2GiB each 6GiB total file size Block size 4KiB Number of IO requests: 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 Initializing worker threads...
Running the test with following options: Number of threads: 32 Initializing random number generator from current time
Extra file open flags: (none) 3 files, 2GiB each 6GiB total file size Block size 4KiB Number of IO requests: 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 Initializing worker threads...
Create VM2 by using the same configuration of VM1, use the same VPC and security group of VM1.
VM Name: lab-EC2-VM2
Volume Name: lab-VM2-Vol
Install apache2-utils :
1 2 3 4 5 6
$ sudo yum -y install httpd-tools
$ ab -V This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
$ ab -n 100000 -c 10 -k http://<vm1-ip>.ec2.internal/ This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Server Software: Apache/2.4.41 Server Hostname: <vm1-ip>.ec2.internal Server Port: 80
Document Path: / Document Length: 3630 bytes
Concurrency Level: 10 Time taken for tests: 14.625 seconds Complete requests: 100000 Failed requests: 0 Non-2xx responses: 100000 Keep-Alive requests: 99017 Total transferred: 393082540 bytes HTML transferred: 363000000 bytes Requests per second: 6837.60 [#/sec] (mean) Time per request: 1.463 [ms] (mean) Time per request: 0.146 [ms] (mean, across all concurrent requests) Transfer rate: 26247.46 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 4 Processing: 0 1 1.3 1 27 Waiting: 0 1 1.3 1 27 Total: 0 1 1.3 1 27
Percentage of the requests served within a certain time (ms) 50% 1 66% 1 75% 2 80% 2 90% 2 95% 3 98% 4 99% 7 100% 27 (longest request)
$ ab -n 100000 -c 100 -k http://<vm1-ip>.ec2.internal/ This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Server Software: Apache/2.4.41 Server Hostname: <vm1-ip>.ec2.internal Server Port: 80
Document Path: / Document Length: 3630 bytes
Concurrency Level: 100 Time taken for tests: 15.796 seconds Complete requests: 100000 Failed requests: 0 Non-2xx responses: 100000 Keep-Alive requests: 99076 Total transferred: 393085813 bytes HTML transferred: 363000000 bytes Requests per second: 6330.91 [#/sec] (mean) Time per request: 15.796 [ms] (mean) Time per request: 0.158 [ms] (mean, across all concurrent requests) Transfer rate: 24302.64 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.3 0 10 Processing: 0 16 11.5 16 206 Waiting: 0 16 11.5 16 206 Total: 0 16 11.5 16 206
Percentage of the requests served within a certain time (ms) 50% 16 66% 17 75% 18 80% 20 90% 26 95% 34 98% 47 99% 58 100% 206 (longest request)
$ ab -n 100000 -c 500 -k http://<vm1-ip>.ec2.internal/ This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Server Software: Apache/2.4.41 Server Hostname: <vm1-ip>.ec2.internal Server Port: 80
Document Path: / Document Length: 3630 bytes
Concurrency Level: 500 Time taken for tests: 20.819 seconds Complete requests: 100000 Failed requests: 160 (Connect: 0, Receive: 0, Length: 160, Exceptions: 0) Non-2xx responses: 99847 Keep-Alive requests: 98961 Total transferred: 392491804 bytes HTML transferred: 362444610 bytes Requests per second: 4803.23 [#/sec] (mean) Time per request: 104.097 [ms] (mean) Time per request: 0.208 [ms] (mean, across all concurrent requests) Transfer rate: 18410.42 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 32.7 0 3065 Processing: 2 72 651.1 29 20784 Waiting: 1 65 623.8 29 20784 Total: 2 73 653.8 29 20806
Percentage of the requests served within a certain time (ms) 50% 29 66% 37 75% 40 80% 40 90% 41 95% 42 98% 45 99% 1061 100% 20806 (longest request)
$ ab -n 100000 -c 1000 -k http://<vm1-ip>.ec2.internal/ This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Server Software: Apache/2.4.41 Server Hostname: <vm1-ip>.ec2.internal Server Port: 80
Document Path: / Document Length: 3630 bytes
Concurrency Level: 1000 Time taken for tests: 30.934 seconds Complete requests: 100000 Failed requests: 385 (Connect: 0, Receive: 0, Length: 385, Exceptions: 0) Non-2xx responses: 99615 Keep-Alive requests: 98750 Total transferred: 391587192 bytes HTML transferred: 361602450 bytes Requests per second: 3232.73 [#/sec] (mean) Time per request: 309.336 [ms] (mean) Time per request: 0.309 [ms] (mean, across all concurrent requests) Transfer rate: 12362.26 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 31.5 0 3077 Processing: 9 156 1531.0 40 30906 Waiting: 1 146 1527.2 40 30906 Total: 9 157 1534.1 40 30925
Percentage of the requests served within a certain time (ms) 50% 40 66% 41 75% 41 80% 42 90% 43 95% 44 98% 59 99% 3163 100% 30925 (longest request)
$ ab -n 1000 -c 100 -k http://<vm1-ip>.ec2.internal/ This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Server Software: Apache/2.4.41 Server Hostname: <vm1-ip>.ec2.internal Server Port: 80
Document Path: / Document Length: 3630 bytes
Concurrency Level: 100 Time taken for tests: 7.021 seconds Complete requests: 1000 Failed requests: 13 (Connect: 0, Receive: 0, Length: 13, Exceptions: 0) Non-2xx responses: 993 Keep-Alive requests: 987 Total transferred: 3905989 bytes HTML transferred: 3604590 bytes Requests per second: 142.43 [#/sec] (mean) Time per request: 702.080 [ms] (mean) Time per request: 7.021 [ms] (mean, across all concurrent requests) Transfer rate: 543.31 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 1.6 0 7 Processing: 1 463 1502.5 1 7011 Waiting: 1 402 1411.4 1 7011 Total: 1 463 1503.9 1 7018
Percentage of the requests served within a certain time (ms) 50% 1 66% 1 75% 2 80% 2 90% 7 95% 5006 98% 5984 99% 5997 100% 7018 (longest request)
$ ab -n 5000 -c 100 -k http://<vm1-ip>.ec2.internal/ This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Server Software: Apache/2.4.41 Server Hostname: <vm1-ip>.ec2.internal Server Port: 80
Document Path: / Document Length: 3630 bytes
Concurrency Level: 100 Time taken for tests: 5.733 seconds Complete requests: 5000 Failed requests: 25 (Connect: 0, Receive: 0, Length: 25, Exceptions: 0) Non-2xx responses: 4975 Keep-Alive requests: 4942 Total transferred: 19558156 bytes HTML transferred: 18059250 bytes Requests per second: 872.22 [#/sec] (mean) Time per request: 114.650 [ms] (mean) Time per request: 1.147 [ms] (mean, across all concurrent requests) Transfer rate: 3331.83 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.7 0 10 Processing: 1 70 540.7 5 5714 Waiting: 1 45 412.4 5 5714 Total: 1 70 541.1 5 5724
Percentage of the requests served within a certain time (ms) 50% 5 66% 5 75% 5 80% 5 90% 6 95% 8 98% 482 99% 4852 100% 5724 (longest request)
$ ab -n 10000 -c 100 -k http://<vm1-ip>.ec2.internal/ This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Server Software: Apache/2.4.41 Server Hostname: <vm1-ip>.ec2.internal Server Port: 80
Document Path: / Document Length: 3630 bytes
Concurrency Level: 100 Time taken for tests: 6.816 seconds Complete requests: 10000 Failed requests: 13 (Connect: 0, Receive: 0, Length: 13, Exceptions: 0) Non-2xx responses: 9987 Keep-Alive requests: 9893 Total transferred: 39259554 bytes HTML transferred: 36252810 bytes Requests per second: 1467.12 [#/sec] (mean) Time per request: 68.161 [ms] (mean) Time per request: 0.682 [ms] (mean, across all concurrent requests) Transfer rate: 5624.85 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.7 0 8 Processing: 1 49 444.0 1 5598 Waiting: 1 43 407.0 1 5598 Total: 1 49 444.2 1 5599
Percentage of the requests served within a certain time (ms) 50% 1 66% 2 75% 2 80% 2 90% 2 95% 2 98% 7 99% 1219 100% 5599 (longest request)