Commit Graph

30 Commits

Author SHA1 Message Date
Dirkjan Ochtman 51685fb760 Upgrade to tokio 1, bytes 1 and rustls 0.19 2021-01-25 08:53:00 +01:00
Benjamin Saunders 1e5a538221 Limit concurrent streams rather than accept queue size
Previously, we limited the number of streams that could be opened by
the peer but not `accept`ed by the application. However, to guarantee
bounded resource use, applications will typically want to limit the
number of streams they process concurrently. While this could
be *approximately* implemented at the application layer by controlling
calls to accept, that approach has a significant drawback: If streams
are slow to process, the worst-case per-stream latency observed by a
peer who opens the maximum number of streams can be arbitrarily bad,
because streams may be opened above the limit the local application is
willing to process. Reducing the number of unaccepted streams
tolerated can reduce the proportion of streams affected, but reducing
it too low will increase the number of round trips required to open
any given number of streams, increasing average latency significantly.

As a side benefit, this reduces the effort needed for applications to
limit concurrency to a fixed quantity, which is expected to be the
overwhelmingly common case. Should a use case for dynamic concurrency
limits arise, we can expose a setter.
2021-01-22 11:39:00 -08:00
Dirkjan Ochtman 17fe82b598 Apply clippy fixes for 1.49 2021-01-01 11:16:05 -08:00
Matthias Einwag 64c97b6af0 Extend benchmark for concurrent streams
This extends the "cargo bench" benchmark to test transmission of data
on multiple streams in parallel.

Ideally we would want all transmission to take a similar amount of time
(bandwidth shared fairly), and the overall throughput to stay the same
or increase (but never degrade) when multiple streams are in use.

The benchmark can not show the fairness aspect very well, since it only
prints an overall throughput. But it shows that performance with
multiple streams stays similar.

Output:

```
running 4 tests
test large_data_10_streams  ... bench: 180,761,260 ns/iter (+/- 12,090,679) = 58 MB/s
test large_data_1_stream    ... bench:  18,459,500 ns/iter (+/- 3,804,219) = 56 MB/s
test small_data_100_streams ... bench:   4,600,890 ns/iter (+/- 373,842)
test small_data_1_stream    ... bench:      71,019 ns/iter (+/- 34,298)
```

I also increased the size of the LARGE_DATA payload from 128kB to
1MB, since 128kB didn't show quinn peak performance.
2020-12-28 14:05:12 +01:00
Dirkjan Ochtman d5b47f601d Unwrap unused results from invalid config values 2020-10-12 12:13:50 -07:00
Dirkjan Ochtman e391c5d05b Remove redundant pattern matching 2020-06-04 22:36:09 +02:00
Benjamin Saunders 0a62e093a6 Replace criterion with bencher 2020-03-31 13:20:30 +02:00
Benjamin Saunders 33a7eb49a4 Fix panic in criterion benchmarks 2020-02-03 06:44:36 +01:00
Benjamin Saunders 5774071b48 Spawn driver tasks implicitly 2020-01-13 09:54:26 +01:00
Benjamin Saunders 09729ebd23 Opaque config structs
Only exposing setters improves forwards compatibility and error
checking.
2020-01-13 08:53:05 +01:00
Benjamin Saunders 1bbb65b6a1 Lint cleanup 2019-12-22 21:13:31 +01:00
Benjamin Saunders 03cd3e27f2 Correct style for latest rustfmt 2019-12-22 09:30:02 +01:00
Benjamin Saunders 875de9f282 Remove datagram benchmarks
These don't make sense when sending always succeeds immediately. They should
return as a stand-alone benchmark that measures the number *received*.
2019-12-17 20:29:08 +01:00
Benjamin Saunders 07e1f33805 Simplified, synchronous datagram send API
Applications sending datagrams are expected to prioritize freshness, at
the cost of reliability if necessary. Blocking datagram sends when the
buffer is full is inconsistent with that, particularly if congestion
arises due to a low-priority bulk data stream. Instead, we should opt to
discard old data in favor of newly sent data. The significant API and
implementation simplification is a nice bonus.
2019-12-17 20:29:08 +01:00
daxpedda 7233455078 Update tokio, futures and bytes. (#528) 2019-12-02 10:42:05 +01:00
Timon Post ac810125c1 merge imports 2019-11-19 08:23:35 +01:00
Benjamin Saunders ec576047e0 Benchmark packet-sized application datagrams 2019-11-16 20:17:59 +01:00
Benjamin Saunders f91df78e77 Tweak benchmarks
Improves comparison between streams and datagrams
2019-11-02 21:11:33 +01:00
Benjamin Saunders a957bf4aa2 Replace slog with tracing 2019-10-29 10:36:50 +01:00
Benjamin Saunders 84d44e40a1 Clarify small stream benchmark character
Hopefully this will reduce apples-to-oranges comparisons with
datagrams.
2019-10-24 10:27:32 +02:00
Benjamin Saunders eba7b65bff Benchmark datagrams 2019-10-24 10:27:32 +02:00
Benjamin Saunders bc3e5af68b Refactor benchmarks 2019-10-22 10:10:55 +02:00
Benjamin Saunders 2dcb084347 Decouple incoming streams of differing directionalities 2019-09-29 07:38:30 +02:00
Benjamin Saunders 8e1c6b605e Remove ToSocketAddrs from EndpointBuilder::bind
Improves consistency with Endpoint::connect and removes the
possibility of silent blocking should the user pass in a domain
name. The generic API was originally motivated by the convenience of
passing in numeric addresses as strings, but `.parse().unwrap()` is
pretty easy too.
2019-09-29 07:21:06 +02:00
Benjamin Saunders d07dc907ad Update for async/await 2019-09-28 10:23:26 +02:00
Benjamin Saunders f50dd9f54a Restore NewConnection struct for parts of a connection
This enables forwards-compatibility with future extensions such as
a datagram stream.
2019-08-25 14:50:01 -07:00
Dirkjan Ochtman b70e939893 Upgrade to criterion 0.3 2019-08-25 13:29:44 -07:00
Dirkjan Ochtman 45ee97bd5a Upgrade to rcgen 0.4 2019-06-18 14:11:40 -07:00
Dirkjan Ochtman 658108729f Adapt to changes in unordered read API 2019-05-21 18:15:19 +02:00
Dirkjan Ochtman 7c35af9f04 Backport benchmarks from nightly branch 2019-05-20 21:25:38 +02:00