日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

BeetleX 之 WebApi网关1.5.8发布

發布時間:2023/12/4 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 BeetleX 之 WebApi网关1.5.8发布 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

????????這一版本的主要升級了BeetleX的基礎網絡庫,主要解決在某些情況導致解釋http協議cpu暴增長的問題,同時使用BeetleX新版本針對的IndexOf的優化,使http協議解釋上有著一定程度的性能提升。

????????新版本同樣也是支持win64和linux64兩個版本,具體安裝使用可查看

【BeetleX之Web網關1.5.7安裝使用】。以下相關功能使用截圖

性能測試

????????對于一個網關來說性能一個比較關心的指標,接下來針對1.5.8做一個簡單的吞吐測試。這些測試也只是簡單地測試一下,使用的操作系統是桌面版本的win10,cpu則是使用E1230V2一款非常老的4核8線程CPU,內存則是16GB,網絡則選用10Gb的光模(主要1Gb無法滿足測試的需求)。

為了能把網關服務壓到極限,所以壓測服務器和API服務器則選擇一臺20核32G內存的WIN2008服務器,確保壓測程序和API服務能夠滿足網關的需求。

????????這一次測試并不是簡單地返回一個字符串,而是更符合實際應用地返回不同大小的數據列表,結構如下:

[{"customerID": "ALFKI","companyName": "Alfreds Futterkiste","contactName": "Maria Anders","contactTitle": "Sales Representative","address": "Obere Str. 57","city": "Berlin","postalCode": "12209","country": "Germany","phone": "030-0074321","fax": "030-0076545"} ]

測試分了5個批次來進行,分別是獲取1,5,10,20和50個客戶信息。測試工具使用bombardier每次使用100并發壓測網關的響應吞吐能力。以下是測試的詳細結果:

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:\>

以下是網關所在操作系統監控50客戶個數獲取的帶寬情況,收發分別是2.8Gb,網關吞吐交互的總帶寬量在6Gb左右。


以上是1.5.8的一些性能測試情況,不過這次測試并沒有反映出網關的最高性能,畢竟操作系統并沒有使用服務器版本進行一個壓測。不過從數據來說在一臺這么舊的電腦上能達到這么高帶寬吞吐交互性上表現已經非常出色。

(提醒:獨立版的網關并發受限,需要授權才能開啟更高并發。想做測試可以引用組件,組件代碼不限制,詳情可訪問:https://github.com/beetlex-io/Bumblebee)?

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的BeetleX 之 WebApi网关1.5.8发布的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。