Commit Graph

58 Commits

Author SHA1 Message Date
Dirkjan Ochtman 2c6aa43610 Apply clippy suggestions from Rust 1.66 2022-12-19 10:13:01 -08:00
Benjamin Saunders 5c7f7aabfa Allow initial MTU to be specified in bulk benchmark 2022-11-27 21:23:24 -08:00
Benjamin Saunders 7d51d2e57e Remove Incoming stream in favor of Endpoint::accept 2022-10-23 08:18:42 +02:00
dependabot[bot] f86dd7596d Update rcgen requirement from 0.9.1 to 0.10.0
Updates the requirements on [rcgen](https://github.com/est31/rcgen) to permit the latest version.
- [Release notes](https://github.com/est31/rcgen/releases)
- [Changelog](https://github.com/est31/rcgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/est31/rcgen/compare/v0.9.1...v0.10.0)

---
updated-dependencies:
- dependency-name: rcgen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 15:29:41 +02:00
Benjamin Saunders 6e4bcbb2fc Drop NewConnection in favor of simpler API 2022-09-27 11:08:26 +02:00
Benjamin Saunders fe93a68108 Replace structopt with its successor, clap 3 2022-07-03 21:02:33 +02:00
matszpk 1d7aa4311d Fixes on bench lib for 32-bit platforms. 2022-06-10 10:17:36 -07:00
Benjamin Saunders c1bd43f3a6 Satisfy clippy 2022-04-08 17:51:22 +02:00
Dirkjan Ochtman 838ad7c471 config: make ClientConfig fields private 2022-02-27 11:03:31 -08:00
Dirkjan Ochtman 5f394099ec Upgrade rcgen to 0.9.1 2022-02-11 13:48:07 -08:00
Benjamin Saunders b2c24d957a Drop futures-util dep from benchmarking tools 2021-12-29 07:34:22 +01:00
Dirkjan Ochtman ee6bbf1d2a Fix clippy suggestions from 1.57 2021-12-10 10:29:12 -08:00
Benjamin Saunders 1159ae3c65 Non-exhaustive ClientConfig 2021-11-10 11:25:19 +01:00
Benjamin Saunders b923c4c8b0 Pass SocketAddr by value
We always consume this by value in the end, and it's a little more
ergonomic.
2021-10-29 20:12:45 +02:00
Benjamin Saunders 5d1b6a101b Remove EndpointBuilder
Now that rustls configuration is more straightforward, this is not
adding significant value.
2021-10-29 20:12:45 +02:00
Benjamin Saunders 495d2927cb Remove certificate newtypes 2021-10-29 08:02:13 +02:00
Dirkjan Ochtman 78dc23614f Disable default features for rustls
In rustls 0.20, TLS 1.2 is optional but enabled by default. We also
don't need to depend on rustls enabling logging.
2021-10-26 11:05:30 -07:00
Dirkjan Ochtman 9daaa15da2 Upgrade to rustls 0.20 2021-10-26 11:05:30 -07:00
Dirkjan Ochtman 5be1824901 Upgrade to tracing-subscriber 0.3 2021-10-25 10:50:32 -07:00
Dirkjan Ochtman 72b99b0372 Drop authors from Cargo manifests
Following RFC 3052.
2021-10-07 09:47:04 +02:00
Dirkjan Ochtman fed3c5cb39 Require explicit construction of ServerConfigs 2021-09-29 10:12:44 -07:00
Dirkjan Ochtman a7efd92044 Require explicit construction of ClientConfigs 2021-09-29 10:12:44 -07:00
Matthias Einwag 8899b1a57b Allow multiple clients in the bulk benchmark
This allows to specify a "--client" parameter in the benchmark,
which specifies the amount of clients which perform a  test concurrently.
Each client uses its own thread and single-threaded runtime.

Stats are currently printed for each individual client and not aggregated.
2021-09-20 21:49:48 +02:00
Matthias Einwag 074da13c4b Allow to specify units for the bulk benchmark
This makes it a bit easier to specify large arguments
2021-09-20 21:49:48 +02:00
Matthias Einwag 8408135208 Allow bulk benchmark in both directions
This changes the bulk benchmark to support server->client
in addition to client->server transfers.

The default direction is set to server->client, since
this is more typically used.
2021-09-20 21:49:48 +02:00
Matthias Einwag 3ac0a05313 Restructure bulk benchmarks
In order to extend the bulk benchmark further, this change moves most
common functions out of the bulk.rs binary and into a lib.rs and stats.rs file.

Functionally there are no relevant changes.
2021-09-20 21:49:48 +02:00
Chris Connelly e63dd77376 Make TransportConfig setters infallible
For most setters this was just a case of changing the signature to take
a `VarInt`.

`max_idle_timeout` was a bit more involved in order to maintain a usable
conversion from `Duration`. The internal representation was changed from
`Duration` from `VarInt`, and an `IdleTimeout` newtype was introduced
for the setter signature. `IdleTimeout` contains a `VarInt`-encoded
millisecond value, and has a fallible conversion from `Duration`. The
use of a newtype is preferable to a direct `Duration` -> `VarInt`
encoding since there could be other `VarInt`-encoded values in future
that use a different resolution than milliseconds.

These changes allow callers to avoid the type-level possibility of error
if they have a `VarInt` (or a value that can be converted infallibly
into one). Fallible conversion from `VarInt` is still convenient with
`TryInto`, and callers can handle the conversion errors without the
indirection of `ConfigError`.

Closes #1176.

BREAKING CHANGE: The `max_concurrent_bidi_streams`,
`max_concurrent_uni_streams`, `stream_receive_window`, and
`receive_window` methods on `TransportConfig` now take `VarInt`
arguments and return `&mut Self`. `TransportConfig::max_idle_timeout`
now takes an `IdleTimeout` argument and returns `&mut Self`.
2021-09-19 18:30:43 -07:00
Marcel Märtens b224d1d0fa switch to futures_utils in tests and benches, also use futures_utils isntead of futures_core 2021-08-11 10:27:32 +02:00
Benjamin Saunders 1082c13167 Idiomatic capitalization of CipherSuite variants 2021-03-26 20:13:33 +01:00
Matthias Einwag 270016a1da Use owned buffer API for sending data in the bulk test
This avoids the allocation inside the the connection Mutex.
2021-03-02 06:49:34 +01:00
Matthias Einwag 80376ff305 Allow to specify the cipher suite in bulk test
rustls defaults to CHACHA20, which is rather slow on desktop hardware.
This change allows to specify a single cipher suite for this test, and
sets the default to AES128.

CHACHA20 (default):
> Sent 4294967296 bytes on 1 streams in 14.86s (275.68 MiB/s)

AES128:
> Sent 4294967296 bytes on 1 streams in 12.21s (335.59 MiB/s)
2021-02-16 19:14:36 +01:00
Matthias Einwag cd974a7945 Disable hdrhistogram features
This causes nom to be pulled in, which currently causes the CI error and build
conflict between `funty` and `bitvec`: https://github.com/myrrlyn/funty/issues/3

We don't need the feature in this scenario anyway.
2021-02-15 07:13:59 +01:00
Matthias Einwag ff542299c4 Allow to use the vectored ordered read API in benchmark
This extends the benchmark to make the consumer either utilize the
ordered or unordered read API.
The ordered read API is now set to the default, since it might be
applicable to more applications.
2021-02-05 10:14:57 +01:00
Dirkjan Ochtman a280b7770f quinn: unify ordered and unordered read APIs 2021-01-30 10:09:09 +01:00
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
Matthias Einwag 6f1687c5fb Fix bulk benchmark
The sending data on the benchmark failed it panicked due
to an unwrap and thereby showed no result. This propagates
the first client-side error instead of panicking - which will also
preserve the statistics.
2021-01-19 08:16:47 +01:00
Dirkjan Ochtman 17fe82b598 Apply clippy fixes for 1.49 2021-01-01 11:16:05 -08:00
Matthias Einwag 62ef3cc1f2 Allow to show connection stats in bulk benchmark
This allows to determine the impact of particular changes a
bit easier.

Example output:

```
Overall stats:

Sent 1073741824 bytes on 1 streams in 4.04s (253.61 MiB/s)

Stream metrics:

      │  Throughput   │ Duration
──────┼───────────────┼──────────
 AVG  │  253.56 MiB/s │     4.04s
 P0   │  253.50 MiB/s │     4.04s
 P10  │  253.62 MiB/s │     4.04s
 P50  │  253.62 MiB/s │     4.04s
 P90  │  253.62 MiB/s │     4.04s
 P100 │  253.62 MiB/s │     4.04s

Server connection stats:
ConnectionStats {
    udp_tx: UdpStats {
        datagrams: 26391,
        bytes: 1110961,
    },
    udp_rx: UdpStats {
        datagrams: 918524,
        bytes: 1116003172,
    },
    frame_tx: FrameStats {
        ACK: 26388,
        CRYPTO: 6,
        DATAGRAM: 0,
        HANDSHAKE_DONE: 4,
        MAX_DATA: 0,
        MAX_STREAM_DATA: 4984,
        MAX_STREAMS_BIDI: 0,
        MAX_STREAMS_UNI: 1,
        NEW_CONNECTION_ID: 16,
        PATH_CHALLENGE: 0,
        PATH_RESPONSE: 0,
        PING: 0,
        RESET_STREAM: 0,
        RETIRE_CONNECTION_ID: 3,
        STOP_SENDING: 0,
        STREAM: 0,
    },
}

Client connection stats:
ConnectionStats {
    udp_tx: UdpStats {
        datagrams: 918556,
        bytes: 1116042037,
    },
    udp_rx: UdpStats {
        datagrams: 26391,
        bytes: 1110961,
    },
    frame_tx: FrameStats {
        ACK: 918554,
        CRYPTO: 2,
        DATAGRAM: 0,
        HANDSHAKE_DONE: 0,
        MAX_DATA: 0,
        MAX_STREAM_DATA: 0,
        MAX_STREAMS_BIDI: 0,
        MAX_STREAMS_UNI: 0,
        NEW_CONNECTION_ID: 5,
        PATH_CHALLENGE: 0,
        PATH_RESPONSE: 0,
        PING: 0,
        RESET_STREAM: 0,
        RETIRE_CONNECTION_ID: 0,
        STOP_SENDING: 0,
        STREAM: 918552,
    },
}
```
2021-01-01 14:23:40 +01:00
Matthias Einwag 1aaff731ab Extend bulk benchmark
This change improves the bulk benchmark:
- The total amount of requests the benchmark performs can be configured
- The amount of concurrent requests on a given connection can be
  configured
- The amount of data to transfer per stream can be configured

E.g.

```
bulk --streams 300 --max_streams 100 --stream_size 10
```

will create 300 streams - with a maximum of 100 active streams at a time,
and send 10MB of data on each stream.

The "short" cli flags are taken form h2load where applicable.

The benchmark now also shows metrics which indicate the performance
of individual streams, which allows to judge fairness. Example output:

```
Overall stats:

Sent 3145728000 bytes on 300 streams in 12.11s (247.81 MiB/s)

Stream metrics:

      │  Throughput   │ Duration
──────┼───────────────┼──────────
 AVG  │  149.17 MiB/s │  396.00ms
 P0   │    0.83 MiB/s │   39.00ms
 P10  │   51.19 MiB/s │   40.00ms
 P50  │  129.75 MiB/s │   77.00ms
 P90  │  247.00 MiB/s │  195.00ms
 P100 │  254.75 MiB/s │    12.11s
```
2020-12-29 15:15:43 +01:00
Matthias Einwag 6d32b64d4c Extract data sending in bulk benchmark
This change moves establishing a stream and sending data into
a separate method.
2020-12-29 15:15:43 +01:00
Dirkjan Ochtman 120c8157ae Update futures-* to 0.3.8
Prevents security issues in futures older than 0.3.5.

Specifically RUSTSEC-2020-0059 and RUSTSEC-2020-0060.
2020-12-21 14:22:18 -08:00
Benjamin Saunders f17eeca4fa Print rate in standalone bulk benchmark 2020-11-09 08:04:01 +01:00
kwantam ee6f7d01f2 pin all crates with rustls as transitive dep
this is necessary for export_keying_material to work;
can be undone once rustls pushes a new version of the crates.
2020-09-29 09:35:14 +02:00
Dirkjan Ochtman 5a4d18f837 Upgrade to rustls-0.18 2020-07-05 23:05:33 +02:00
Dirkjan Ochtman 73fbb9bdee tracing-subscriber 0.2.5 is required since 77aeb5544 2020-06-04 22:36:09 +02:00
Dirkjan Ochtman eeac018bd9 Update license to proper SPDX expression
From the Cargo docs:

"Previously multiple licenses could be separated with a /,
but that usage is deprecated."

https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields
2020-05-04 09:14:22 -07:00
Benjamin Saunders e0319215b7 Lighten tracing-subscriber
Omitting json logging gets serde out of our dev-dependency closure
2020-03-31 13:20:30 +02:00
Dirkjan Ochtman 67f448c553 Bump rcgen to 0.8 to avoid duplicate dependency 2020-03-12 19:23:52 +01:00
stammw 0ff3d8f51d H3: set FrameDecoder initial buffersize to UDP size 2020-03-10 13:23:00 +01:00