You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After hitting hyperium/tonic#103 I decided to look for the source of latency in tonic.
Please have a look at two trivial servers and clients. In both cases the client and the server talk over the loopback device, so there is very little latency in the link.
The server is the echo server from the tokio examples collection. The client proceeds this way:
send a few bytes to the server,
wait for a complete echo to come back,
repeat.
This test uses http/2 so that a single connection is reused for all requests.
On my test machine, this client runs 16K iterations in 0.75sec.
hyper-test
The server responds to any request with "Hello, world!\n". Essentially, it is hyper/examples/multi_server.rs with "multi" part removed. The client proceeds this way:
On my test machine, this client runs 16K iterations in 35.10sec.
There is an interesting aspect to the second test: neither the server, nor the client use 100% CPU. In fact, the server uses approx. 15% CPU. Essentially, it sleeps instead of serving requests.
Where does so much latency and idle time come from in hyper?
I've used the following package versions:
tokio 0.2.0-alpha.6,
hyper 0.13.0-alpha.4,
rustc 1.39.0-beta.7 (23f8f652b 2019-10-26),
Linux 5.3.6-300.fc31.x86_64
The text was updated successfully, but these errors were encountered:
Hi,
After hitting hyperium/tonic#103 I decided to look for the source of latency in tonic.
Please have a look at two trivial servers and clients. In both cases the client and the server talk over the loopback device, so there is very little latency in the link.
tokio-test.tar.gz
hyper-test.tar.gz
tokio-test
The server is the echo server from the tokio examples collection. The client proceeds this way:
This test uses http/2 so that a single connection is reused for all requests.
On my test machine, this client runs 16K iterations in 0.75sec.
hyper-test
The server responds to any request with "Hello, world!\n". Essentially, it is hyper/examples/multi_server.rs with "multi" part removed. The client proceeds this way:
On my test machine, this client runs 16K iterations in 35.10sec.
There is an interesting aspect to the second test: neither the server, nor the client use 100% CPU. In fact, the server uses approx. 15% CPU. Essentially, it sleeps instead of serving requests.
Where does so much latency and idle time come from in hyper?
I've used the following package versions:
The text was updated successfully, but these errors were encountered: