--- tags: Linux2020 高效能網頁伺服器 tiles: 高效能網頁伺服器 - lwan's bench test --- contributed by < `YLowy` > # lwan 的 bench test [Web Framework Benchmarks](https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=json) 中 lwan web server 在 JSON serialization 中達到了第 12 名。其透過[FrameworkBenchmarks](https://github.com/TechEmpower/FrameworkBenchmarks)測試各種不同的網頁之效能做排名。 ![](https://i.imgur.com/RKe2tOs.png) ![](https://i.imgur.com/kbLhQn3.png) ## ab.exe 不準? [對 seHTTPd 進行壓力測試](https://hackmd.io/@sysprog/linux2020-sehttpd#%E5%B0%8D-seHTTPd-%E9%80%B2%E8%A1%8C%E5%A3%93%E5%8A%9B%E6%B8%AC%E8%A9%A6) ## weighttp 工具 對local host 進行測試 :  ```shell= weighttp -n 10000 -c 10 -t 4 -k localhost: ``` ## 比較 - nginx server ### nginx 12447 req/s ```shell= $ weighttp -n 10000 -c 10 -t 4 -k localhost:80 weighttp 0.4 - a lightweight and simple webserver benchmarking tool starting benchmark... spawning thread #1: 3 concurrent requests, 2500 total requests spawning thread #2: 3 concurrent requests, 2500 total requests spawning thread #3: 2 concurrent requests, 2500 total requests spawning thread #4: 2 concurrent requests, 2500 total requests progress: 10% done progress: 20% done progress: 30% done progress: 40% done progress: 50% done progress: 60% done progress: 70% done progress: 80% done progress: 90% done progress: 100% done finished in 0 sec, 803 millisec and 361 microsec, 12447 req/s, 10441 kbyte/s requests: 10000 total, 10000 started, 10000 done, 10000 succeeded, 0 failed, 0 errored status codes: 10000 2xx, 0 3xx, 0 4xx, 0 5xx traffic: 8589525 bytes total, 2469525 bytes http, 6120000 bytes data ``` ### lwan 32139 req/s ```shell= $ weighttp -n 10000 -c 10 -t 4 -k localhost:8080 weighttp 0.4 - a lightweight and simple webserver benchmarking tool starting benchmark... spawning thread #1: 3 concurrent requests, 2500 total requests spawning thread #2: 3 concurrent requests, 2500 total requests spawning thread #3: 2 concurrent requests, 2500 total requests spawning thread #4: 2 concurrent requests, 2500 total requests progress: 10% done progress: 20% done progress: 30% done progress: 40% done progress: 50% done progress: 60% done progress: 70% done progress: 80% done progress: 90% done progress: 100% done finished in 0 sec, 311 millisec and 143 microsec, 32139 req/s, 6057 kbyte/s requests: 10000 total, 10000 started, 10000 done, 10000 succeeded, 0 failed, 0 errored status codes: 10000 2xx, 0 3xx, 0 4xx, 0 5xx traffic: 1930000 bytes total, 1800000 bytes http, 130000 bytes data ```