下文給大家?guī)?lái)AWS基于MySQL/postgres開(kāi)發(fā)的Aurora的性能測(cè)試,希望能夠給大家在實(shí)際運(yùn)用中帶來(lái)一定的幫助,
10年積累的做網(wǎng)站、成都網(wǎng)站建設(shè)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站設(shè)計(jì)后付款的網(wǎng)站建設(shè)流程,更有絳縣免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
MYSQL涉及的東西比較多,理論也不多,網(wǎng)上有很多書(shū)籍,今天我們就用創(chuàng)新互聯(lián)在行業(yè)內(nèi)累計(jì)的經(jīng)驗(yàn)來(lái)做一個(gè)解答。
AWS基于Mysql/postgres開(kāi)發(fā)的Aurora,是個(gè)很熱門(mén)的OLTP數(shù)據(jù)庫(kù)產(chǎn)品。目前很多用戶很關(guān)心Aurora。
各種官方的性能測(cè)試,也充分展示了Aurora的強(qiáng)勁實(shí)力。
閑來(lái)無(wú)事,通過(guò)sybench,測(cè)試一下Aurora Mysql和RDS原生Mysql之間性能差異。測(cè)試結(jié)果僅供參考。
網(wǎng)絡(luò)上比較流行的一張性能對(duì)比圖,越大的機(jī)型,性能aurora的性能優(yōu)勢(shì)體現(xiàn)的越好。
測(cè)試環(huán)境準(zhǔn)備,由于Aurora目前只有中國(guó)寧夏區(qū)有提供服務(wù),所以測(cè)試環(huán)境都是基于寧夏Region測(cè)試的。
<1. EC2 m4.xlarge (4CPU 16G)
<2. RDS db.r4.xlarge (4 vCPU 30.5 GiB ) Mysql版本5.7.12
<3. Aurora db.r4.xlarge (4 vCPU 30.5 GiB ) Mysql版本5.7.12
<4. 為了減少網(wǎng)絡(luò)因素的影響,將這些機(jī)器,都放置在同一個(gè)AZ。
<5. EC2 選擇 Amazon AMI2,并安裝sysbench1.0.17
<6. Mysql創(chuàng)建20個(gè)表,每個(gè)表1000W行數(shù)據(jù),數(shù)據(jù)量在40G左右(避免數(shù)據(jù)全部cache到內(nèi)存中,而測(cè)試不到IO的性能影響)。
<7. 還另外插入20表,100W行/表,做插入時(shí)間比對(duì)。
1. 數(shù)據(jù)庫(kù)中插入20個(gè)表,每個(gè)表100W行數(shù)據(jù),看插入時(shí)間比較。Mysql 耗時(shí) 5m32.238s,Aurora耗時(shí)7m28.073s。
Mysql | Aurora |
mysql -hmysql-rds.cq7qaukj3smd.rds.cn-northwest-1.amazonaws.com.cn \ -uadmin -padmin123 -e "create database dbtest;" | mysql -hmyaurora.cq7qaukj3smd.rds.cn-northwest-1.amazonaws.com.cn \ -uadmin -padmin123 -e "create database dbtest1;" |
time sysbench /root/sysbench-1.0/tests/include/oltp_legacy/oltp.lua \ --mysql-host=mysql-rds.cq7qaukj3smd.rds.cn-northwest-1.amazonaws.com.cn \ --mysql-port=3306 --mysql-user=admin --mysql-password=admin123 \ --mysql-db=dbtest --oltp-tables-count=20 --oltp-table-size=1000000 \ --report-interval=10 --rand-init=on --max-requests=0 \ --oltp-read-only=off --time=120 --threads=30 \ prepare | time sysbench /root/sysbench-1.0/tests/include/oltp_legacy/oltp.lua \ --mysql-host=myaurora.cq7qaukj3smd.rds.cn-northwest-1.amazonaws.com.cn \ --mysql-port=3306 --mysql-user=admin --mysql-password=admin123 \ --mysql-db=dbtest --oltp-tables-count=20 --oltp-table-size=1000000 \ --report-interval=10 --rand-init=on --max-requests=0 \ --oltp-read-only=off --time=120 --threads=30 \ prepare |
sysbench 1.0.17 (using bundled LuaJIT 2.1.0-beta2) Creating table 'sbtest1'... Inserting 1000000 records into 'sbtest1' Creating secondary indexes on 'sbtest1'... ....... Creating table 'sbtest20'... Inserting 1000000 records into 'sbtest20' Creating secondary indexes on 'sbtest20'... real 5m32.238s user 1m25.953s sys 0m2.070s | sysbench 1.0.17 (using bundled LuaJIT 2.1.0-beta2) Creating table 'sbtest1'... Inserting 1000000 records into 'sbtest1' Creating secondary indexes on 'sbtest1'... ...... Creating table 'sbtest20'... Inserting 1000000 records into 'sbtest20' Creating secondary indexes on 'sbtest20'... real 7m28.073s user 1m26.931s sys 0m2.020s |
2. Aurora的鏈接方式,以及replica的的只讀訪問(wèn)的連接分配
Aurora直接連接點(diǎn)個(gè)數(shù)據(jù)庫(kù)節(jié)點(diǎn)的Endpoint方式
mysql -hmyaurora.cq7qaukj3smd.rds.cn-northwest-1.amazonaws.com.cn \ -uadmin -padmin123 -e "create database dbtest1;"
Aurora通過(guò)Cluster Endpoint進(jìn)行連接
連接到主庫(kù),進(jìn)行寫(xiě)入和讀取操作
cluster-aurora.cluster-cq7qaukj3smd.rds.cn-northwest-1.amazonaws.com.cn
連接到replica 數(shù)據(jù)庫(kù),進(jìn)行只讀操作,會(huì)自動(dòng)分配連接到不同的可用slave上
cluster-aurora.cluster-ro-cq7qaukj3smd.rds.cn-northwest-1.amazonaws.com.cn
多次并行發(fā)起查詢測(cè)試,可以看到,連接會(huì)到不同的slave節(jié)點(diǎn)上,這點(diǎn)也是Aurora的優(yōu)點(diǎn),大并發(fā)的讀操作,會(huì)比傳統(tǒng)的Mysql更有優(yōu)勢(shì)。
3. Aurora和Mysql的性能比較
并發(fā)連接數(shù) | Mysql | Aurora |
50 | [ 10s ] thds: 50 tps: 1849.09 qps: 29630.08 (r/w/o: 25927.11/0.00/3702.97) lat (ms,95%): 34.33 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 50 tps: 1874.96 qps: 29997.87 (r/w/o: 26248.25/0.00/3749.62) lat (ms,95%): 33.72 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 50 tps: 1874.99 qps: 29997.87 (r/w/o: 26247.70/0.00/3750.17) lat (ms,95%): 33.72 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 50 tps: 1874.87 qps: 30000.64 (r/w/o: 26250.71/0.00/3749.93) lat (ms,95%): 34.33 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 50 tps: 1875.21 qps: 29997.98 (r/w/o: 26247.77/0.00/3750.21) lat (ms,95%): 34.33 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 50 tps: 1874.80 qps: 29999.94 (r/w/o: 26250.55/0.00/3749.39) lat (ms,95%): 33.72 err/s: 0.00 reconn/s: 0.00 [ 70s ] thds: 50 tps: 1874.80 qps: 29993.58 (r/w/o: 26243.67/0.00/3749.91) lat (ms,95%): 33.72 err/s: 0.00 reconn/s: 0.00 [ 80s ] thds: 50 tps: 1874.60 qps: 29997.26 (r/w/o: 26248.06/0.00/3749.19) lat (ms,95%): 33.72 err/s: 0.00 reconn/s: 0.00 [ 90s ] thds: 50 tps: 1875.10 qps: 30002.85 (r/w/o: 26252.74/0.00/3750.11) lat (ms,95%): 33.72 err/s: 0.00 reconn/s: 0.00 [ 100s ] thds: 50 tps: 1874.90 qps: 29991.28 (r/w/o: 26241.49/0.00/3749.80) lat (ms,95%): 34.33 err/s: 0.00 reconn/s: 0.00 [ 110s ] thds: 50 tps: 1874.80 qps: 29995.09 (r/w/o: 26245.49/0.00/3749.60) lat (ms,95%): 34.33 err/s: 0.00 reconn/s: 0.00 [ 120s ] thds: 50 tps: 1874.60 qps: 30001.10 (r/w/o: 26251.60/0.00/3749.50) lat (ms,95%): 34.33 err/s: 0.00 reconn/s: 0.00 SQL statistics: queries performed: read: 3146934 write: 0 other: 449562 total: 3596496 transactions: 224781 (1872.71 per sec.) queries: 3596496 (29963.32 per sec.) ignored errors: 0 (0.00 per sec.) reconnects: 0 (0.00 per sec.) General statistics: total time: 120.0281s total number of events: 224781 Latency (ms): min: 14.61 avg: 26.69 max: 232.74 95th percentile: 33.72 sum: 5999324.56 Threads fairness: events (avg/stddev): 4495.6200/80.91 execution time (avg/stddev): 119.9865/0.01 | [ 10s ] thds: 50 tps: 1477.63 qps: 29616.44 (r/w/o: 20740.64/5915.43/2960.36) lat (ms,95%): 39.65 err/s: 0.10 reconn/s: 0.00 [ 20s ] thds: 50 tps: 1513.95 qps: 30280.99 (r/w/o: 21196.66/6056.52/3027.81) lat (ms,95%): 38.94 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 50 tps: 1525.30 qps: 30506.87 (r/w/o: 21351.98/6104.49/3050.40) lat (ms,95%): 38.94 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 50 tps: 1489.00 qps: 29790.93 (r/w/o: 20855.52/5957.11/2978.30) lat (ms,95%): 38.94 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 50 tps: 1525.90 qps: 30495.97 (r/w/o: 21344.68/6099.49/3051.80) lat (ms,95%): 38.94 err/s: 0.10 reconn/s: 0.00 [ 60s ] thds: 50 tps: 1525.20 qps: 30500.57 (r/w/o: 21352.28/6097.79/3050.50) lat (ms,95%): 38.94 err/s: 0.20 reconn/s: 0.00 [ 70s ] thds: 50 tps: 1519.76 qps: 30418.62 (r/w/o: 21295.75/6083.14/3039.72) lat (ms,95%): 38.94 err/s: 0.00 reconn/s: 0.00 [ 80s ] thds: 50 tps: 1514.44 qps: 30290.88 (r/w/o: 21201.44/6060.46/3028.98) lat (ms,95%): 39.65 err/s: 0.10 reconn/s: 0.00 [ 90s ] thds: 50 tps: 1528.50 qps: 30541.43 (r/w/o: 21378.25/6107.09/3056.09) lat (ms,95%): 38.94 err/s: 0.00 reconn/s: 0.00 [ 100s ] thds: 50 tps: 1525.60 qps: 30525.45 (r/w/o: 21371.84/6101.61/3052.01) lat (ms,95%): 38.94 err/s: 0.00 reconn/s: 0.00 [ 110s ] thds: 50 tps: 1531.60 qps: 30649.13 (r/w/o: 21451.42/6134.41/3063.30) lat (ms,95%): 38.94 err/s: 0.00 reconn/s: 0.00 [ 120s ] thds: 50 tps: 1530.98 qps: 30599.71 (r/w/o: 21421.06/6116.70/3061.95) lat (ms,95%): 38.94 err/s: 0.20 reconn/s: 0.00 SQL statistics: queries performed: read: 2549946 write: 728532 other: 364271 total: 3642749 transactions: 182132 (1517.33 per sec.) queries: 3642749 (30347.45 per sec.) ignored errors: 7 (0.06 per sec.) reconnects: 0 (0.00 per sec.) General statistics: total time: 120.0329s total number of events: 182132 Latency (ms): min: 23.77 avg: 32.94 max: 242.92 95th percentile: 38.94 sum: 5999931.34 Threads fairness: events (avg/stddev): 3642.6400/60.99 execution time (avg/stddev): 119.9986/0.01 |
200 | [ 10s ] thds: 200 tps: 1806.49 qps: 29082.59 (r/w/o: 25450.42/0.00/3632.17) lat (ms,95%): 287.38 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 200 tps: 1872.27 qps: 29938.76 (r/w/o: 26194.32/0.00/3744.43) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 200 tps: 1870.84 qps: 29939.76 (r/w/o: 26198.29/0.00/3741.47) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 200 tps: 1871.85 qps: 29936.38 (r/w/o: 26192.89/0.00/3743.50) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 200 tps: 1868.90 qps: 29910.80 (r/w/o: 26172.90/0.00/3737.90) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 200 tps: 1870.90 qps: 29932.17 (r/w/o: 26190.28/0.00/3741.90) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 [ 70s ] thds: 200 tps: 1870.00 qps: 29912.47 (r/w/o: 26173.56/0.00/3738.91) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 [ 80s ] thds: 200 tps: 1868.70 qps: 29910.59 (r/w/o: 26172.10/0.00/3738.50) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 [ 90s ] thds: 200 tps: 1869.80 qps: 29905.41 (r/w/o: 26166.00/0.00/3739.40) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 [ 100s ] thds: 200 tps: 1869.10 qps: 29914.46 (r/w/o: 26175.96/0.00/3738.49) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 [ 110s ] thds: 200 tps: 1868.84 qps: 29904.69 (r/w/o: 26167.01/0.00/3737.69) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 [ 120s ] thds: 200 tps: 1869.16 qps: 29903.95 (r/w/o: 26165.73/0.00/3738.22) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00 SQL statistics: queries performed: read: 3135608 write: 0 other: 447944 total: 3583552 transactions: 223972 (1863.11 per sec.) queries: 3583552 (29809.72 per sec.) ignored errors: 0 (0.00 per sec.) reconnects: 0 (0.00 per sec.) General statistics: total time: 120.2124s total number of events: 223972 Latency (ms): min: 16.44 avg: 107.20 max: 1902.74 95th percentile: 282.25 sum: 24009065.40 Threads fairness: events (avg/stddev): 1119.8600/46.71 execution time (avg/stddev): 120.0453/0.05 | [ 10s ] thds: 200 tps: 1960.15 qps: 39454.72 (r/w/o: 27662.63/7851.70/3940.39) lat (ms,95%): 158.63 err/s: 0.10 reconn/s: 0.00 [ 20s ] thds: 200 tps: 2081.52 qps: 41639.62 (r/w/o: 29153.63/8323.26/4162.73) lat (ms,95%): 147.61 err/s: 0.20 reconn/s: 0.00 [ 30s ] thds: 200 tps: 2073.24 qps: 41453.60 (r/w/o: 29015.76/8291.66/4146.18) lat (ms,95%): 147.61 err/s: 0.20 reconn/s: 0.00 [ 40s ] thds: 200 tps: 2083.85 qps: 41681.48 (r/w/o: 29178.18/8334.90/4168.40) lat (ms,95%): 147.61 err/s: 0.20 reconn/s: 0.00 [ 50s ] thds: 200 tps: 2082.82 qps: 41672.60 (r/w/o: 29168.08/8339.78/4164.74) lat (ms,95%): 142.39 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 200 tps: 2085.22 qps: 41689.36 (r/w/o: 29185.75/8332.57/4171.04) lat (ms,95%): 147.61 err/s: 0.10 reconn/s: 0.00 [ 70s ] thds: 200 tps: 2076.47 qps: 41565.44 (r/w/o: 29094.41/8317.09/4153.94) lat (ms,95%): 144.97 err/s: 0.10 reconn/s: 0.00 [ 80s ] thds: 200 tps: 2079.72 qps: 41561.98 (r/w/o: 29091.96/8310.78/4159.24) lat (ms,95%): 147.61 err/s: 0.10 reconn/s: 0.00 [ 90s ] thds: 200 tps: 2077.21 qps: 41548.95 (r/w/o: 29088.41/8305.73/4154.82) lat (ms,95%): 147.61 err/s: 0.10 reconn/s: 0.00 [ 100s ] thds: 200 tps: 2073.17 qps: 41492.22 (r/w/o: 29045.12/8300.76/4146.33) lat (ms,95%): 144.97 err/s: 0.00 reconn/s: 0.00 [ 110s ] thds: 200 tps: 2071.53 qps: 41420.77 (r/w/o: 28992.27/8285.33/4143.17) lat (ms,95%): 147.61 err/s: 0.10 reconn/s: 0.00 [ 120s ] thds: 200 tps: 2083.84 qps: 41665.27 (r/w/o: 29163.81/8333.77/4167.69) lat (ms,95%): 142.39 err/s: 0.00 reconn/s: 0.00 SQL statistics: queries performed: read: 3479070 write: 993990 other: 496998 total: 4970058 transactions: 248493 (2069.16 per sec.) queries: 4970058 (41384.83 per sec.) ignored errors: 12 (0.10 per sec.) reconnects: 0 (0.00 per sec.) General statistics: total time: 120.0918s total number of events: 248493 Latency (ms): min: 26.14 avg: 96.61 max: 671.69 95th percentile: 147.61 sum: 24005672.73 Threads fairness: events (avg/stddev): 1242.4650/27.91 execution time (avg/stddev): 120.0284/0.02 |
400 | [ 10s ] thds: 400 tps: 1708.49 qps: 27644.70 (r/w/o: 24189.80/0.00/3454.90) lat (ms,95%): 759.88 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 400 tps: 1864.73 qps: 29854.98 (r/w/o: 26124.72/0.00/3730.26) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 400 tps: 1861.30 qps: 29785.11 (r/w/o: 26062.91/0.00/3722.20) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 400 tps: 1862.40 qps: 29800.42 (r/w/o: 26076.32/0.00/3724.10) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 400 tps: 1862.70 qps: 29787.67 (r/w/o: 26062.57/0.00/3725.10) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 400 tps: 1861.70 qps: 29793.17 (r/w/o: 26068.96/0.00/3724.21) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 70s ] thds: 400 tps: 1860.95 qps: 29795.76 (r/w/o: 26073.35/0.00/3722.41) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 80s ] thds: 400 tps: 1862.53 qps: 29780.26 (r/w/o: 26057.09/0.00/3723.17) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 90s ] thds: 400 tps: 1862.59 qps: 29801.95 (r/w/o: 26075.27/0.00/3726.68) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 100s ] thds: 400 tps: 1862.49 qps: 29782.71 (r/w/o: 26058.62/0.00/3724.09) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 110s ] thds: 400 tps: 1860.73 qps: 29800.90 (r/w/o: 26079.55/0.00/3721.35) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 120s ] thds: 400 tps: 1861.85 qps: 29789.60 (r/w/o: 26064.80/0.00/3724.80) lat (ms,95%): 682.06 err/s: 0.00 reconn/s: 0.00 SQL statistics: queries performed: read: 3112564 write: 0 other: 444652 total: 3557216 transactions: 222326 (1839.03 per sec.) queries: 3557216 (29424.51 per sec.) ignored errors: 0 (0.00 per sec.) reconnects: 0 (0.00 per sec.) General statistics: total time: 120.8911s total number of events: 222326 Latency (ms): min: 17.64 avg: 216.09 max: 6575.08 95th percentile: 694.45 sum: 48043259.68 Threads fairness: events (avg/stddev): 555.8150/34.28 execution time (avg/stddev): 120.1081/0.10 | [ 10s ] thds: 400 tps: 1436.60 qps: 29126.77 (r/w/o: 20462.54/5760.62/2903.60) lat (ms,95%): 331.91 err/s: 0.16 reconn/s: 0.00 [ 20s ] thds: 400 tps: 2835.57 qps: 56687.28 (r/w/o: 39685.07/11328.99/5673.23) lat (ms,95%): 282.25 err/s: 0.98 reconn/s: 0.00 [ 30s ] thds: 400 tps: 2031.40 qps: 40646.92 (r/w/o: 28455.91/8127.80/4063.20) lat (ms,95%): 277.21 err/s: 0.30 reconn/s: 0.00 [ 40s ] thds: 400 tps: 2046.70 qps: 40951.31 (r/w/o: 28660.10/8197.70/4093.50) lat (ms,95%): 277.21 err/s: 0.30 reconn/s: 0.00 [ 50s ] thds: 400 tps: 2042.50 qps: 40850.18 (r/w/o: 28601.99/8162.90/4085.30) lat (ms,95%): 277.21 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 400 tps: 2041.60 qps: 40852.91 (r/w/o: 28601.01/8168.50/4083.40) lat (ms,95%): 277.21 err/s: 0.10 reconn/s: 0.00 [ 70s ] thds: 400 tps: 2049.80 qps: 40976.34 (r/w/o: 28682.93/8194.81/4098.60) lat (ms,95%): 277.21 err/s: 0.10 reconn/s: 0.00 [ 80s ] thds: 400 tps: 2045.70 qps: 40892.45 (r/w/o: 28621.36/8181.19/4089.89) lat (ms,95%): 277.21 err/s: 0.00 reconn/s: 0.00 [ 90s ] thds: 400 tps: 2048.50 qps: 40959.30 (r/w/o: 28666.20/8194.40/4098.70) lat (ms,95%): 277.21 err/s: 0.00 reconn/s: 0.00 [ 100s ] thds: 400 tps: 2042.50 qps: 40883.32 (r/w/o: 28627.91/8169.90/4085.50) lat (ms,95%): 277.21 err/s: 0.20 reconn/s: 0.00 [ 110s ] thds: 400 tps: 2044.40 qps: 40907.80 (r/w/o: 28636.20/8181.90/4089.70) lat (ms,95%): 277.21 err/s: 0.30 reconn/s: 0.00 [ 120s ] thds: 400 tps: 2040.30 qps: 40786.06 (r/w/o: 28548.37/8157.89/4079.80) lat (ms,95%): 277.21 err/s: 0.20 reconn/s: 0.00 SQL statistics: queries performed: read: 3409112 write: 973956 other: 486992 total: 4870060 transactions: 243484 (2025.82 per sec.) queries: 4870060 (40519.49 per sec.) ignored errors: 24 (0.20 per sec.) reconnects: 0 (0.00 per sec.) General statistics: total time: 120.1887s total number of events: 243484 Latency (ms): min: 27.83 avg: 197.26 max: 1384.29 95th percentile: 282.25 sum: 48029766.12 Threads fairness: events (avg/stddev): 608.7100/17.12 execution time (avg/stddev): 120.0744/0.05 |
500 | [ 10s ] thds: 500 tps: 1682.10 qps: 27339.35 (r/w/o: 23928.16/0.00/3411.18) lat (ms,95%): 1069.86 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 500 tps: 1859.51 qps: 29763.11 (r/w/o: 26043.38/0.00/3719.73) lat (ms,95%): 893.56 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 500 tps: 1862.16 qps: 29757.08 (r/w/o: 26034.07/0.00/3723.01) lat (ms,95%): 893.56 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 500 tps: 1860.50 qps: 29769.67 (r/w/o: 26047.77/0.00/3721.90) lat (ms,95%): 877.61 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 500 tps: 1858.20 qps: 29744.31 (r/w/o: 26027.41/0.00/3716.90) lat (ms,95%): 893.56 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 500 tps: 1859.05 qps: 29751.23 (r/w/o: 26032.84/0.00/3718.39) lat (ms,95%): 893.56 err/s: 0.00 reconn/s: 0.00 [ 70s ] thds: 500 tps: 1857.00 qps: 29709.55 (r/w/o: 25996.05/0.00/3713.51) lat (ms,95%): 893.56 err/s: 0.00 reconn/s: 0.00 [ 80s ] thds: 500 tps: 1855.85 qps: 29692.62 (r/w/o: 25981.22/0.00/3711.40) lat (ms,95%): 877.61 err/s: 0.00 reconn/s: 0.00 [ 90s ] thds: 500 tps: 1856.50 qps: 29701.50 (r/w/o: 25987.90/0.00/3713.60) lat (ms,95%): 893.56 err/s: 0.00 reconn/s: 0.00 [ 100s ] thds: 500 tps: 1856.40 qps: 29698.68 (r/w/o: 25985.79/0.00/3712.90) lat (ms,95%): 877.61 err/s: 0.00 reconn/s: 0.00 [ 110s ] thds: 500 tps: 1855.70 qps: 29694.47 (r/w/o: 25984.17/0.00/3710.30) lat (ms,95%): 877.61 err/s: 0.00 reconn/s: 0.00 [ 120s ] thds: 500 tps: 1855.77 qps: 29677.97 (r/w/o: 25966.63/0.00/3711.35) lat (ms,95%): 893.56 err/s: 0.00 reconn/s: 0.00 SQL statistics: queries performed: read: 3103646 write: 0 other: 443378 total: 3547024 transactions: 221689 (1826.44 per sec.) queries: 3547024 (29223.11 per sec.) ignored errors: 0 (0.00 per sec.) reconnects: 0 (0.00 per sec.) General statistics: total time: 121.3755s total number of events: 221689 Latency (ms): min: 15.33 avg: 271.03 max: 14421.92 95th percentile: 893.56 sum: 60084600.60 Threads fairness: events (avg/stddev): 443.3780/41.56 execution time (avg/stddev): 120.1692/0.17 | [ 10s ] thds: 500 tps: 1756.86 qps: 35777.43 (r/w/o: 25168.49/7045.13/3563.81) lat (ms,95%): 450.77 err/s: 0.70 reconn/s: 0.00 [ 20s ] thds: 500 tps: 2022.60 qps: 40455.28 (r/w/o: 28320.46/8088.72/4046.11) lat (ms,95%): 350.33 err/s: 0.60 reconn/s: 0.00 [ 30s ] thds: 500 tps: 2005.60 qps: 40100.25 (r/w/o: 28070.44/8019.21/4010.61) lat (ms,95%): 356.70 err/s: 0.30 reconn/s: 0.00 [ 40s ] thds: 500 tps: 1996.50 qps: 39933.57 (r/w/o: 27949.78/7989.79/3994.00) lat (ms,95%): 363.18 err/s: 0.70 reconn/s: 0.00 [ 50s ] thds: 500 tps: 2003.70 qps: 40091.81 (r/w/o: 28065.94/8017.48/4008.39) lat (ms,95%): 356.70 err/s: 0.10 reconn/s: 0.00 [ 60s ] thds: 500 tps: 2017.40 qps: 40370.37 (r/w/o: 28265.05/8071.21/4034.11) lat (ms,95%): 356.70 err/s: 0.00 reconn/s: 0.00 [ 70s ] thds: 500 tps: 2001.90 qps: 40010.43 (r/w/o: 28004.82/8001.51/4004.10) lat (ms,95%): 363.18 err/s: 0.20 reconn/s: 0.00 [ 80s ] thds: 500 tps: 2020.20 qps: 40416.12 (r/w/o: 28293.61/8081.50/4041.00) lat (ms,95%): 356.70 err/s: 0.30 reconn/s: 0.00 [ 90s ] thds: 500 tps: 2038.00 qps: 40780.69 (r/w/o: 28543.99/8159.90/4076.80) lat (ms,95%): 350.33 err/s: 0.60 reconn/s: 0.00 [ 100s ] thds: 500 tps: 2044.50 qps: 40891.41 (r/w/o: 28630.80/8171.40/4089.20) lat (ms,95%): 350.33 err/s: 0.20 reconn/s: 0.00 [ 110s ] thds: 500 tps: 2043.20 qps: 40906.68 (r/w/o: 28634.19/8185.60/4086.90) lat (ms,95%): 350.33 err/s: 0.40 reconn/s: 0.00 [ 120s ] thds: 500 tps: 2039.60 qps: 40741.57 (r/w/o: 28521.48/8141.39/4078.70) lat (ms,95%): 350.33 err/s: 0.30 reconn/s: 0.00 SQL statistics: queries performed: read: 3366272 write: 961658 other: 480852 total: 4808782 transactions: 240404 (1999.47 per sec.) queries: 4808782 (39995.15 per sec.) ignored errors: 44 (0.37 per sec.) reconnects: 0 (0.00 per sec.) General statistics: total time: 120.2323s total number of events: 240404 Latency (ms): min: 27.67 avg: 249.78 max: 2979.37 95th percentile: 356.70 sum: 60047338.15 Threads fairness: events (avg/stddev): 480.8080/13.27 execution time (avg/stddev): 120.0947/0.06 |
800 | [ 10s ] thds: 800 tps: 1779.10 qps: 29156.96 (r/w/o: 25523.06/0.00/3633.90) lat (ms,95%): 694.45 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 800 tps: 1859.36 qps: 29741.61 (r/w/o: 26022.38/0.00/3719.23) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 800 tps: 1864.54 qps: 29763.68 (r/w/o: 26036.30/0.00/3727.38) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 800 tps: 1857.70 qps: 29790.88 (r/w/o: 26075.08/0.00/3715.80) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 800 tps: 1859.97 qps: 29814.49 (r/w/o: 26092.34/0.00/3722.15) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 800 tps: 1866.26 qps: 29782.61 (r/w/o: 26050.79/0.00/3731.83) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 70s ] thds: 800 tps: 1862.42 qps: 29773.50 (r/w/o: 26048.87/0.00/3724.64) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 80s ] thds: 800 tps: 1860.50 qps: 29758.94 (r/w/o: 26039.24/0.00/3719.71) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 90s ] thds: 800 tps: 1860.91 qps: 29751.72 (r/w/o: 26030.71/0.00/3721.02) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 100s ] thds: 800 tps: 1857.49 qps: 29799.90 (r/w/o: 26083.01/0.00/3716.89) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 110s ] thds: 800 tps: 1861.00 qps: 29811.66 (r/w/o: 26088.26/0.00/3723.39) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 120s ] thds: 800 tps: 1865.69 qps: 29777.93 (r/w/o: 26047.55/0.00/3730.38) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 SQL statistics: queries performed: read: 3126956 write: 0 other: 446708 total: 3573664 transactions: 223354 (1849.87 per sec.) queries: 3573664 (29597.91 per sec.) ignored errors: 0 (0.00 per sec.) reconnects: 0 (0.00 per sec.) General statistics: total time: 120.7387s total number of events: 223354 Latency (ms): min: 304.23 avg: 430.57 max: 2410.01 95th percentile: 669.89 sum: 96168909.94 Threads fairness: events (avg/stddev): 279.1925/6.35 execution time (avg/stddev): 120.2111/0.13 | [ 10s ] thds: 800 tps: 1518.66 qps: 24886.45 (r/w/o: 21773.07/0.00/3113.38) lat (ms,95%): 1327.91 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 800 tps: 1857.90 qps: 29815.64 (r/w/o: 26099.14/0.00/3716.50) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 800 tps: 1859.14 qps: 29709.10 (r/w/o: 25992.82/0.00/3716.29) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 800 tps: 1864.14 qps: 29854.60 (r/w/o: 26123.51/0.00/3731.09) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 800 tps: 1860.33 qps: 29726.22 (r/w/o: 26008.86/0.00/3717.35) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 800 tps: 1859.50 qps: 29826.21 (r/w/o: 26104.61/0.00/3721.60) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 70s ] thds: 800 tps: 1866.49 qps: 29764.49 (r/w/o: 26032.10/0.00/3732.38) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 80s ] thds: 800 tps: 1853.53 qps: 29750.01 (r/w/o: 26044.44/0.00/3705.56) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 90s ] thds: 800 tps: 1866.05 qps: 29837.62 (r/w/o: 26102.02/0.00/3735.60) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 100s ] thds: 800 tps: 1858.43 qps: 29716.02 (r/w/o: 26003.56/0.00/3712.47) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 110s ] thds: 800 tps: 1859.81 qps: 29819.31 (r/w/o: 26097.09/0.00/3722.23) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 [ 120s ] thds: 800 tps: 1861.39 qps: 29769.77 (r/w/o: 26047.58/0.00/3722.18) lat (ms,95%): 669.89 err/s: 0.00 reconn/s: 0.00 SQL statistics: queries performed: read: 3089212 write: 0 other: 441316 total: 3530528 transactions: 220658 (1823.64 per sec.) queries: 3530528 (29178.29 per sec.) ignored errors: 0 (0.00 per sec.) reconnects: 0 (0.00 per sec.) General statistics: total time: 120.9967s total number of events: 220658 Latency (ms): min: 307.80 avg: 435.76 max: 1975.11 95th percentile: 682.06 sum: 96154020.08 Threads fairness: events (avg/stddev): 275.8225/6.05 execution time (avg/stddev): 120.1925/0.13 |
4. AWS官方blog也有測(cè)試輸出,Aurora的性能比Mysql好不少。具體可以參考。
https://amazonaws-china.com/cn/blogs/china/aurora-test/?nc1=b_rp
我的測(cè)試環(huán)境,相對(duì)來(lái)說(shuō),單表更多的行數(shù),也是有一些區(qū)別的。
個(gè)人感覺(jué),由于Aurora不直接寫(xiě)datafile,只寫(xiě)binlog的方式,勢(shì)必比Mysql要寫(xiě)datafile快很多。而且在越大數(shù)據(jù)庫(kù),和硬件配置的情況下。IO這部分的影響會(huì)越明顯。
另外Aurora的多slave讀取共享數(shù)據(jù)文件的情況,也會(huì)讓slave的數(shù)據(jù)同步,比傳統(tǒng)Mysql slave要更實(shí)時(shí)。
并且replica slave的cluster域名訪問(wèn),自動(dòng)分配查詢到不同的slave,也節(jié)省從應(yīng)用層面做load balance更簡(jiǎn)易。
而且aurora可以結(jié)合AWS auto-scaling,做到彈性伸縮。才能真正體會(huì)“云”的優(yōu)勢(shì)。
看了以上關(guān)于AWS基于Mysql/postgres開(kāi)發(fā)的Aurora的性能測(cè)試,如果大家還有什么地方需要了解的可以在創(chuàng)新互聯(lián)行業(yè)資訊里查找自己感興趣的或者找我們的專(zhuān)業(yè)技術(shù)工程師解答的,創(chuàng)新互聯(lián)技術(shù)工程師在行業(yè)內(nèi)擁有十幾年的經(jīng)驗(yàn)了。
分享文章:AWS基于Mysql/postgres開(kāi)發(fā)的Aurora的性能測(cè)試
文章鏈接:http://aaarwkj.com/article30/gooepo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導(dǎo)航、品牌網(wǎng)站制作、建站公司、企業(yè)網(wǎng)站制作、虛擬主機(jī)、定制網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)