~ » wrk -c 10 -t 4 -d 10s http://localhost:8080/plaintext
Running 10s test @ http://localhost:8080/plaintext
4 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 122.52us 60.65us 3.49ms 92.02%
Req/Sec 16.12k 1.48k 17.62k 88.86%
647915 requests in 10.10s, 79.71MB read
Requests/sec: 64151.56
Transfer/sec: 7.89MB
Code used: tokio-minihttp examples/techempower.rs
Note: It appears that tokio-minihttp is actually running on two threads meaning that it must be utilizing my two CPU cores. Nim on the other hand is single threaded.
Compiled with -d:release -d:useRealtimeGC
and GC_setMaxPause(10)
.
~ » wrk -c 10 -t 4 -d 10s http://localhost:8080/plaintext
Running 10s test @ http://localhost:8080/plaintext
4 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 207.64us 64.55us 2.68ms 94.94%
Req/Sec 9.60k 566.43 10.26k 84.90%
385992 requests in 10.10s, 18.41MB read
Requests/sec: 38216.87
Transfer/sec: 1.82MB
Code used:
import asynchttpserver, asyncdispatch
var server = newAsyncHttpServer()
proc cb(req: Request) {.async.} =
await req.respond(Http200, "Hello World")
GC_setMaxPause(10)
waitFor server.serve(Port(8080), cb)
Note: This is single threaded!