Commit Graph

12 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
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
Benjamin Saunders f17eeca4fa Print rate in standalone bulk benchmark 2020-11-09 08:04:01 +01:00
Benjamin Saunders 5774071b48 Spawn driver tasks implicitly 2020-01-13 09:54:26 +01:00
Timon 73b1011ba0 Fixed Clippy Warnings (#531)
* Fixed clippy errors

* removed statement
2019-12-02 19:31:32 +01:00
daxpedda 7233455078 Update tokio, futures and bytes. (#528) 2019-12-02 10:42:05 +01:00
Benjamin Saunders 3ffa250b35 Add minimal self-contained benchmark for easy profiling 2019-11-21 09:07:36 +01:00