BeetleX 之 WebApi网关1.5.8发布
????????這一版本的主要升級了BeetleX的基礎(chǔ)網(wǎng)絡(luò)庫,主要解決在某些情況導(dǎo)致解釋http協(xié)議cpu暴增長的問題,同時使用BeetleX新版本針對的IndexOf的優(yōu)化,使http協(xié)議解釋上有著一定程度的性能提升。
????????新版本同樣也是支持win64和linux64兩個版本,具體安裝使用可查看
【BeetleX之Web網(wǎng)關(guān)1.5.7安裝使用】。以下相關(guān)功能使用截圖
性能測試
????????對于一個網(wǎng)關(guān)來說性能一個比較關(guān)心的指標(biāo),接下來針對1.5.8做一個簡單的吞吐測試。這些測試也只是簡單地測試一下,使用的操作系統(tǒng)是桌面版本的win10,cpu則是使用E1230V2一款非常老的4核8線程CPU,內(nèi)存則是16GB,網(wǎng)絡(luò)則選用10Gb的光模(主要1Gb無法滿足測試的需求)。
為了能把網(wǎng)關(guān)服務(wù)壓到極限,所以壓測服務(wù)器和API服務(wù)器則選擇一臺20核32G內(nèi)存的WIN2008服務(wù)器,確保壓測程序和API服務(wù)能夠滿足網(wǎng)關(guān)的需求。
????????這一次測試并不是簡單地返回一個字符串,而是更符合實際應(yīng)用地返回不同大小的數(shù)據(jù)列表,結(jié)構(gòu)如下:
測試分了5個批次來進(jìn)行,分別是獲取1,5,10,20和50個客戶信息。測試工具使用bombardier每次使用100并發(fā)壓測網(wǎng)關(guān)的響應(yīng)吞吐能力。以下是測試的詳細(xì)結(jié)果:
D:\>bombardier.exe -c 100 -n 1000000 http://192.168.2.18/customers?count=1 Bombarding http://192.168.2.18/customers?count=1 with 1000000 request(s) using 1 00 connection(s)1000000 / 1000000 [==============================================] 100.00% 22s Done! Statistics Avg Stdev MaxReqs/sec 44083.12 3238.01 49047.30Latency 2.27ms 2.98ms 609.03msHTTP codes:1xx - 0, 2xx - 1000000, 3xx - 0, 4xx - 0, 5xx - 0others - 0Throughput: 19.59MB/s D:\>bombardier.exe -c 100 -n 1000000 http://192.168.2.18/customers?count=5 Bombarding http://192.168.2.18/customers?count=5 with 1000000 request(s) using 1 00 connection(s)1000000 / 1000000 [==============================================] 100.00% 21s Done! Statistics Avg Stdev MaxReqs/sec 46818.87 5258.01 54296.74Latency 2.13ms 2.22ms 615.03msHTTP codes:1xx - 0, 2xx - 1000000, 3xx - 0, 4xx - 0, 5xx - 0others - 0Throughput: 66.88MB/s D:\>bombardier.exe -c 100 -n 1000000 http://192.168.2.18/customers?count=10 Bombarding http://192.168.2.18/customers?count=10 with 1000000 request(s) using 100 connection(s)1000000 / 1000000 [==============================================] 100.00% 23s Done! Statistics Avg Stdev MaxReqs/sec 42954.14 4766.32 53000.00Latency 2.33ms 2.57ms 606.03msHTTP codes:1xx - 0, 2xx - 1000000, 3xx - 0, 4xx - 0, 5xx - 0others - 0Throughput: 113.73MB/s D:\>bombardier.exe -c 100 -n 1000000 http://192.168.2.18/customers?count=20 Bombarding http://192.168.2.18/customers?count=20 with 1000000 request(s) using 100 connection(s)1000000 / 1000000 [==============================================] 100.00% 27s Done! Statistics Avg Stdev MaxReqs/sec 36768.81 1938.67 40747.56Latency 2.72ms 86.82us 30.00msHTTP codes:1xx - 0, 2xx - 1000000, 3xx - 0, 4xx - 0, 5xx - 0others - 0Throughput: 184.96MB/s D:\>bombardier.exe -c 100 -n 1000000 http://192.168.2.18/customers?count=50 Bombarding http://192.168.2.18/customers?count=50 with 1000000 request(s) using 100 connection(s)1000000 / 1000000 [==============================================] 100.00% 39s Done! Statistics Avg Stdev MaxReqs/sec 25329.65 2414.78 28948.41Latency 3.94ms 2.41ms 626.03msHTTP codes:1xx - 0, 2xx - 1000000, 3xx - 0, 4xx - 0, 5xx - 0others - 0Throughput: 314.18MB/s D:\>以下是網(wǎng)關(guān)所在操作系統(tǒng)監(jiān)控50客戶個數(shù)獲取的帶寬情況,收發(fā)分別是2.8Gb,網(wǎng)關(guān)吞吐交互的總帶寬量在6Gb左右。
以上是1.5.8的一些性能測試情況,不過這次測試并沒有反映出網(wǎng)關(guān)的最高性能,畢竟操作系統(tǒng)并沒有使用服務(wù)器版本進(jìn)行一個壓測。不過從數(shù)據(jù)來說在一臺這么舊的電腦上能達(dá)到這么高帶寬吞吐交互性上表現(xiàn)已經(jīng)非常出色。
(提醒:獨立版的網(wǎng)關(guān)并發(fā)受限,需要授權(quán)才能開啟更高并發(fā)。想做測試可以引用組件,組件代碼不限制,詳情可訪問:https://github.com/beetlex-io/Bumblebee)?
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的BeetleX 之 WebApi网关1.5.8发布的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: .NET6 中的 PriorityQue
- 下一篇: 读《有效需求分析》