Closed jaemk closed 6 years ago
Some test results (numbers are req/s) to confirm the default mode isn't affected:
cargo run --release --example hello-world
wrk -t4 -c100 -d10s http://localhost:8000
current | new - thread | new - threadpool |
---|---|---|
25500 | 25200 | 102200 |
cargo run --release --example database
# insert some data
curl -X POST -d 'some data' -H 'Content-Type: text/plain' http://locahost:8000/note
wrk -t4 -c100 -d10s http://localhost:8000/notes
current | new - thread | new - threadpool |
---|---|---|
6850 | 6820 | 8100 |
The code looks good. Please also add an entry to CHANGELOG.md.
Changelog is updated!
issue #167
threadpool
,num_cpus
start_server_with_pool
function that mirrors the existingstart_server
functionExecutor
instance to theServer
to spawn server processes in either astd::thread
or athreadpool::ThreadPool
Server::run
signature to take a reference instead of ownership so it mirrorsServer::poll
and can be chained after a call toServer::pool_size