tiny_httpd
tiny_httpd copied to clipboard
try multicore
This was done just out of curiosity as I wanted to try the multicore compiler. I'm leaving this as a draft here in-case you want to try this on the multicore branch and/or use it for tests as the multicore project progresses :)
Some rough numbers from my naive wrk based testing
Test command: ./_build/default/src/examples/echo.exe -j 128
Numbers from the thread based implementation on the current release
➜ tiny_httpd git:(master) ✗ wrk -t4 -c96 -d15s --latency "http://127.0.0.1:8080/hello"
Running 15s test @ http://127.0.0.1:8080/hello
4 threads and 96 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.33ms 3.01ms 116.84ms 94.27%
Req/Sec 11.82k 1.49k 43.51k 98.17%
Latency Distribution
50% 1.97ms
75% 3.04ms
90% 4.50ms
99% 8.14ms
706580 requests in 15.10s, 1.38GB read
Requests/sec: 46794.26
Transfer/sec: 93.45MB
Numbers from this branch with domainslib:
➜ tiny_httpd git:(try-multicore) wrk -t4 -c96 -d15s --latency "http://127.0.0.1:8080/hello"
Running 15s test @ http://127.0.0.1:8080/hello
4 threads and 96 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 97.24us 689.25us 41.86ms 99.35%
Req/Sec 56.87k 7.97k 70.87k 62.33%
Latency Distribution
50% 54.00us
75% 65.00us
90% 74.00us
99% 321.00us
1696983 requests in 15.05s, 3.31GB read
Requests/sec: 112752.17
Transfer/sec: 225.17MB
Both tests are run on a 4 core intel 8th gen 8550u cpu.
This is impressive speed up. Did you try with two distant machine?
You can use moonpool for that now, I have a bench here :)