Skip to content

Commit 877b76f

Browse files
committed
Add tquic-goodput-debug.yml for debuging
1 parent 8af4622 commit 877b76f

File tree

6 files changed

+122
-2
lines changed

6 files changed

+122
-2
lines changed
+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: GoodputDebug
2+
3+
on:
4+
schedule:
5+
- cron: '30 1 * * *'
6+
workflow_dispatch:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
QUIC_IMAGES: gquiche=tquicgroup/qirgq,lsquic=tquicgroup/qirls,picoquic=tquicgroup/qirpq,quiche=tquicgroup/qircq
11+
12+
jobs:
13+
measure:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
impl: [tquic,lsquic]
19+
case: [goodput10m]
20+
cc: [bbr]
21+
22+
# The scheduled workflow only runs for the main repository.
23+
# You can manually trigger it if necessary.
24+
if: ${{ ( github.event_name == 'schedule' && github.repository == 'tencent/tquic' ) || github.event_name == 'workflow_dispatch' }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
submodules: 'recursive'
29+
30+
- name: Build docker image
31+
run: docker build -t tquic_interop:v1 -f interop/Dockerfile .
32+
33+
- name: Install quic-interop-runner
34+
run: |
35+
git clone https://github.com/tquic-group/quic-interop-runner.git
36+
cd quic-interop-runner
37+
pip3 install -r requirements.txt
38+
39+
- name: Install dependencies
40+
run: |
41+
sudo modprobe ip6table_filter
42+
sudo add-apt-repository -y ppa:wireshark-dev/stable
43+
sudo apt install -y tshark
44+
45+
- name: Run the interop tests
46+
run: |
47+
cd quic-interop-runner
48+
python3 run.py -r "$QUIC_IMAGES,tquic=tquic_interop:v1" -s ${{ matrix.impl }} -c ${{ matrix.impl }} -t ${{ matrix.case }} -a ${{ matrix.cc }} -d -n "drop-rate --delay=15ms --bandwidth=30Mbps --queue=25 --rate_to_server=0 --rate_to_client=0" -j ${{ matrix.case }}-0-${{ matrix.cc }}-${{ matrix.impl }}.json
49+
50+
- name: Store measurement results
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: ${{ matrix.case }}-${{ matrix.cc }}-${{ matrix.impl }}
54+
path: quic-interop-runner/*
55+
56+
result:
57+
runs-on: ubuntu-latest
58+
needs: measure
59+
steps:
60+
- name: Download all workflow run artifacts
61+
uses: actions/download-artifact@v4
62+
63+
- name: Display structure of downloaded files
64+
run: ls -R
65+
66+
- name: Display all measurement details
67+
run: grep "details.*" . -Ro
68+
69+
- name: Download plot tools
70+
uses: actions/checkout@v4
71+
with:
72+
path: tools
73+
74+
- name: Install dependencies
75+
run: |
76+
sudo apt install python3-matplotlib
77+
78+
- name: Plot all measurement results
79+
run: python3 tools/.github/workflows/plot-goodput.py .
80+
81+
- name: Store all measurement results
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: goodput-all-result
85+
path: goodput*

interop/run_endpoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ esac
6464

6565
# Note: You can add extra command-line options to tquic_client/tquic_sever by
6666
# using the `EXTRA_ARGS` environment variable.
67-
COMMON_ARGS="--keylog-file $SSLKEYLOGFILE --log-level DEBUG --log-file $LOG_DIR/$ROLE.log --idle-timeout 30000 --handshake-timeout 30000 --initial-rtt 100 --congestion-control-algor $CC_ALGOR $EXTRA_ARGS"
67+
COMMON_ARGS="--keylog-file $SSLKEYLOGFILE --log-level trace --log-file $LOG_DIR/$ROLE.log --idle-timeout 30000 --handshake-timeout 30000 --initial-rtt 100 --congestion-control-algor $CC_ALGOR $EXTRA_ARGS"
6868

6969
if [ "$TESTCASE" != "transfer" ]; then
7070
COMMON_ARGS="$COMMON_ARGS --qlog-dir $QLOG_DIR"

src/connection/connection.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2364,6 +2364,10 @@ impl Connection {
23642364
.map(|(&k, &v)| (k, v))
23652365
.collect::<Vec<(u64, u64)>>()
23662366
{
2367+
log::debug!(
2368+
"~~~ stream {} is blocked, sending STREAM_DATA_BLOCKED",
2369+
stream_id
2370+
);
23672371
let frame = frame::Frame::StreamDataBlocked {
23682372
stream_id,
23692373
max: limit,

src/connection/flowcontrol.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ impl FlowControl {
103103
/// Return true if the available window is smaller than the half
104104
/// of the current window.
105105
pub fn should_send_max_data(&self) -> bool {
106-
(self.max_data - self.read_off) * 2 < self.window
106+
let v = (self.max_data - self.read_off) * 2 < self.window;
107+
log::debug!(
108+
"~~~ should_send_max_data {}: max_data {} - read_off {} < window {} / 2",
109+
v,
110+
self.max_data,
111+
self.read_off,
112+
self.window
113+
);
114+
v
107115
}
108116

109117
/// Get the next max_data limit which will be sent to the peer

src/connection/stream.rs

+22
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,21 @@ impl StreamMap {
379379
let empty_fin = buf_len == 0 && fin;
380380

381381
if written < buf_len {
382+
log::debug!(
383+
"~~~ stream {} not all data has been written buf_len {}, written{}",
384+
stream_id,
385+
buf_len,
386+
written
387+
);
382388
let max_data = stream.send.max_data();
383389

384390
if stream.send.blocked_at() != Some(max_data) {
391+
log::debug!(
392+
"~~~ stream {} sendbuf blocked_at() {:?} != max_data() {:?}, mark stream blocked",
393+
stream_id,
394+
stream.send.blocked_at(),
395+
Some(max_data)
396+
);
385397
stream.send.update_blocked_at(Some(max_data));
386398
self.mark_blocked(stream_id, true, max_data);
387399
}
@@ -525,6 +537,12 @@ impl StreamMap {
525537
// The connection-level flow control credit is not enough, mark the connection
526538
// blocked and schedule a DATA_BLOCKED frame to be sent to the peer.
527539
if self.max_tx_data_left() < len as u64 {
540+
trace!(
541+
"{} stream {} was blocked by connection-level flow control at {}",
542+
self.trace_id,
543+
stream_id,
544+
self.send_capacity.max_data
545+
);
528546
self.update_data_blocked_at(Some(self.send_capacity.max_data));
529547
}
530548

@@ -544,6 +562,10 @@ impl StreamMap {
544562
if stream.send.capacity()? < len {
545563
let max_data = stream.send.max_data();
546564
if stream.send.blocked_at() != Some(max_data) {
565+
debug!(
566+
"~~~ stream {} was blocked by stream-level flow control at {}",
567+
stream_id, max_data
568+
);
547569
stream.send.update_blocked_at(Some(max_data));
548570
self.mark_blocked(stream_id, true, max_data);
549571
}

tools/src/bin/tquic_client.rs

+1
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ impl Worker {
546546
config.enable_multipath(option.enable_multipath);
547547
config.set_multipath_algorithm(option.multipath_algor);
548548
config.set_active_connection_id_limit(option.active_cid_limit);
549+
config.enable_pacing(false);
549550
config.enable_encryption(!option.disable_encryption);
550551
let tls_config = TlsConfig::new_client_config(
551552
ApplicationProto::convert_to_vec(&option.alpn),

0 commit comments

Comments
 (0)