接口性能測試之(日誌級別)

最近一直在作接口相關的性能功能,總結記錄下一些當中遇到的問題以及優化辦法;併發

下面有一組數據直接表示出日誌輸出對性能的影響性能

debug日誌級別性能測試數據以下:測試

concurrent threads: 50, times: 10000
total cost time(ms): 44393ms, avg time(ms): 4.4393
tps: 225.2607393057464優化


concurrent threads: 100, times: 10000
total cost time(ms): 46994ms, avg time(ms): 4.6994
tps: 212.79312252627994debug


concurrent threads: 500, times: 10000
total cost time(ms): 45189ms, avg time(ms): 4.5189
tps: 221.29279249374846日誌

concurrent threads: 1000, times: 100000
total cost time(ms): 472001ms, avg time(ms): 4.72001
tps: 211.8639579153434接口

error日誌級別性能測試數據以下:thread

concurrent threads: 50, times: 10000
total cost time(ms): 35381ms, avg time(ms): 3.5381
tps: 282.6375738390662bug

concurrent threads: 100, times: 10000
total cost time(ms): 28896ms, avg time(ms): 2.8896
tps: 346.0686600221484程序

concurrent threads: 500, times: 10000
total cost time(ms): 32018ms, avg time(ms): 3.2018
tps: 312.3243175713661

        標記50,100,500併發測試的性能數據,error日誌級別的tps要比debug日誌級別的tps多了將近1/3;之前一直只知道日誌級別確定會有差別,可是沒有想今天這樣子測試下,到底會差異多少;不過最終的影響結果仍是得看程序的日誌打印狀況;

相關文章
相關標籤/搜索