Simple Web Benchmark(他の多くの言語のグラフがあります)に触発された、HTTPサーバーをテストするための単純なフレームワークですが、dlangフレームワークとライブラリに焦点を当てています。
プレーンテキストスクリプトで達成可能なRPS(1秒あたりのリクエスト数)を測定します。
テストはさまざまな場所(TechEmpowerを含む)から収集または変更されています。
Dockerコンテナを使用してサービスを構築およびホストし、ローカルで実行することも、リモートホストからロードテスターを使用することもできます。
ロード・ジェネレータはデフォルトでWRK貯水池からの要求の統計が、ちょっともサポート(ちょうど--toolキーを使用します)。
テストはdockerなしで実行でき、テストされた言語のコンパイラとwrk / heyブートジェネレータをインストールする必要があります(ただし、Linuxでのみテストされます)。
io_uringテストに関する注意:
- テストには、少なくともLinux5.7カーネルが必要です。
- 通常のユーザーで実行すると、ユーザーがロックしたメモリ制限(ulimit -l)にも問題が発生する可能性があります。
- , Kernel 5.7.16. . : #189, #8.
:
- singleCore — / ( ).
- multiCore —
- make build —
- make shell —
: .
, ( ):
make all # runs all tests
make single # runs tests limited to single CPU core usage
make multi # runs tests limited to multiple CPU cores usage
_suite/runner.d CLI-.
- _suite/runner.d list — -
- _suite/runner.d bench —
- _suite/runner.d responses —
- _suite/runner.d versions — Markdown
_suite/runner.d -h CLI .
:
_suite/runner.d bench --type singleCore dlang rust # dlang rust
:
- , , .
- - _suite/runner.d bench --type singleCore -r foo@192.168.0.3 --host 192.168.0.2 dlang
-r --remote , ssh. --host , CLI IP , , .
ssh , ssh ( ).
(hey) .
, , .
/
, .
- (.. ..)
- HTTP-
, , , , , .
C
. HTTP-, eventloop .
epoll io_uring. raw.
dlang
. http :
- process — , .
- threads — threadpool
- hybrid — Linux , .
singeCore, ( ) eventloop, (.. CGI) .
- raw — , , ( , ,… — )
TBD — / io_uring, epoll Linux-.
, , . , — , during/raw
, vibe-d. epoll linux (iocp kqueue windows MacOS).
, http , , .
- callbacks — .
- fibers —
- hunt-http — (HTTP-, )
- hunt-pico — , picohttpparser ( , , ...) — , Techempower
, .
Weka.
.
: druntime, . . , .
code.dlang.org, , syscalls glibc epoll eventloop , .
nodejs http-parser ( , pico) .
, eventcore .
- , TCPConnection , .
, http .
- dlang, .
dotnet
, ( , , ...). .. , .
golang
fasthttp .
HTTP , .
rust
Actix :
- actix-web —
- actix-raw —
Single core results ()
: AMD Ryzen 7 3700X 8-Core, kernel 5.8.10
: Intel® Core(TM) i5-5300U CPU @ 2.30GHz, kernel 5.8.9
: 1Gbps through cheap gigabit switch
: for i in 8 64 128 256; do _suite/runner.d bench --type singleCore --tool wrk -b 2 -d 120 -c $i -r tomas@10.0.0.2; done
| go | go1.15.1 |
| ldc2 | 1.23.0 |
| rust | 1.48.0-nightly |
| dotnet | 5.0.100-rc.1.20452.10 |
翻訳者から。結果のあるテーブルの完全版は、元ので表示できます。しかし、すべてが明らかに混同されているわけではないので、2つのカテゴリ(微調整のない本格的なフレームワークと基本的なライブラリを含むその他すべて)について、2分間に処理されたリクエストの数(req、rpsに比例)についてより視覚的なグラフを作成しました。そして2つの結果-8人の労働者と256人がスケーラビリティを示しています。

そして、はい、TechEmpowerのテストは、微調整されたバージョンを通常のバージョンと混合し、場所によってはかなり装飾されています。