用wrk測試nginx/ndoejs/golang

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。

硬體環境

$ lscpuArchitecture: x86_64CPU 運行模式: 32-bit, 64-bitByte Order: Little EndianCPU(s): 8On-line CPU(s) list: 0-7每個核的線程數:2每個座的核心數: 4Socket(s): 1NUMA 節點: 1廠商 ID: GenuineIntelCPU 系列: 6型號: 58Model name: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz步進: 9CPU MHz: 2021.406CPU max MHz: 3900.0000CPU min MHz: 1600.0000BogoMIPS: 6784.72虛擬化: VT-xL1d 緩衝: 32KL1i 緩衝: 32KL2 緩衝: 256KL3 緩衝: 8192KNUMA node0 CPU(s): 0-7Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts

被測試服務端均只返回“hello world”的body體。

用戶端使用wrk,在本機測試。

第一名:wrk -> go-fasthttp: 40w TPS

$ time ./wrk -c 100 -d 20 -t 4 http://127.0.0.1:8081/Running 20s test @ http://127.0.0.1:8081/4 threads and 100 connectionsThread Stats Avg Stdev Max +/- StdevLatency 303.36us 483.32us 13.28ms 93.65%Req/Sec 100.77k 6.97k 120.41k 72.50%8026927 requests in 20.02s, 1.09GB readRequests/sec: 400953.00Transfer/sec: 55.83MBreal 0m20.024suser 0m11.548ssys 0m44.760s

第二名:wrk -> nginx(openresty+echo-nginx-module): 29w TPS

$ time ./wrk -c 100 -d 20 -t 4 http://127.0.0.1:8081/Running 20s test @ http://127.0.0.1:8081/4 threads and 100 connectionsThread Stats Avg Stdev Max +/- StdevLatency 750.38us 1.48ms 33.83ms 90.27%Req/Sec 73.30k 10.52k 105.78k 69.75%5847086 requests in 20.08s, 1.08GB readRequests/sec: 291202.39Transfer/sec: 54.99MBreal 0m20.083suser 0m11.256ssys 0m34.452s

第三名:wrk -> libevent.http: 28w TPS

$ time ./wrk -c 100 -d 20 -t 4 http://127.0.0.1:8081/dumpRunning 20s test @ http://127.0.0.1:8081/dump4 threads and 100 connectionsThread Stats Avg Stdev Max +/- StdevLatency 797.46us 1.44ms 30.28ms 88.51%Req/Sec 71.08k 14.56k 115.91k 69.50%5671928 requests in 20.06s, 649.10MB readRequests/sec: 282719.55Transfer/sec: 32.35MBreal 0m20.066suser 0m7.340ssys 0m33.364s

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.