From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I2w1nkPR; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 655995A08B5 for ; Wed, 12 Nov 2025 11:32:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762943528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=r3vxoRXnn/9KdrLNw8hukOUosGA19ZtZq2mvoSWBNgs=; b=I2w1nkPRCrmu5PvZXt9jdU1vYDOgAIo0bWRbQCg2jzXM9U/I5LeMj6pBOFpep4p9Iq+lIn tGUPgj6RQAh/iSBsSgqdLr4qDXoVexhEjz+pOiEHMcsdK9ldfdtdTvYxWuzPIyiWstucnN ZVLNiR3jCLT5TxMzJm4HR3lvsDf+TX4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-30-QrRbG5G4Ouy2VGdI5QFnzg-1; Wed, 12 Nov 2025 05:32:06 -0500 X-MC-Unique: QrRbG5G4Ouy2VGdI5QFnzg-1 X-Mimecast-MFC-AGG-ID: QrRbG5G4Ouy2VGdI5QFnzg_1762943525 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4776079ada3so5576875e9.1 for ; Wed, 12 Nov 2025 02:32:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762943525; x=1763548325; h=mime-version:organization:references:in-reply-to:message-id:subject :cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=r3vxoRXnn/9KdrLNw8hukOUosGA19ZtZq2mvoSWBNgs=; b=QFmbhEYTyCsQOTlaI2rovf8Qr3LNe+SbShS+Ao3HMYOsm5u/n/5YDP0bMVe8OcU4xg 4xE5sEudr5gqoM2bFXMcIIFAAqYfuyWoQ3EBtSuEVSKyMplGXWwpOWqABRAT8vG5sg02 q4TZjpIOHhpw3LlZPiDLq9/hhchwVx5iBIhRWC8JR84VU5Ko42qFOM5uHEIzS0VwUrFt mxRklaDbPws1ApiWxYQyZD06cUDIGQ+8jSVArLGFNGJKlzn18TiI79tYYc178BqiE1DH LAIfv4kUbN/4xDqbuPM2Qmdxr1bCmF8JudVvQDHGu+vPRxU8srK/wl0qyzBFj583fwlD GiiA== X-Gm-Message-State: AOJu0YwPBWaoHKbpuMM+wz7xqzqqOHylsjqWaNfVirhrHd1bRhFut4Lz oZNzshpWUrcBNfLWrPKardMvZoPNGbo7q+T20JQ1vPXHAWhA0YYK3nFWFIOTuzALMzetsCydpqS RHHQOZiubr5jS3y70//N/CT+Fl9kRqpLgeJssy2uIF4jNp4l9ReF1ZTM= X-Gm-Gg: ASbGncuvOJEwFE3Eo3YTtV8KrHcSUHcHn+3xRc2qCgWl1J98UDcAt3uo4oHeyr0qxV5 HLJJShbazlI+RJZ7HwcSKVMwzYHt7b3RIHwk7I5Jm4f4D+PNY1OgwbtnmPBK3wgWXZUThRCSmLw u9shdU3cUQjAhg3G04zdXhzLQ92eBTdYtpVALc7GCiy+4cNj1Zcjia6BHZp+qTAdYmFmocxjW00 TASzKqbpAU1o7ZaJFg9rxMHFD87NtW4RDc86PgV/m5RVC9z7dMKm5GDzCvC27rJaLjjjHneT4oC NWp0b6V5TEenXk6dLbuYQSkbcgfnhcdJiHgG9pxNqmlC7diiSJLxYU41F9CPkaAdefTfJAdjUtj reKtGPx4pkAW8tJuNn4uAhL4ZNho= X-Received: by 2002:a05:600c:1c26:b0:477:55ce:f3bc with SMTP id 5b1f17b1804b1-477870c52bamr27275085e9.19.1762943525099; Wed, 12 Nov 2025 02:32:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEdrkPSJYi46blGyu5rPyMWHjWmGpYXmM9OSkLYyDCzQ9304TS7ub5LCBBpPX+kERNPOytaTA== X-Received: by 2002:a05:600c:1c26:b0:477:55ce:f3bc with SMTP id 5b1f17b1804b1-477870c52bamr27274735e9.19.1762943524583; Wed, 12 Nov 2025 02:32:04 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47787e8e6acsm27979475e9.9.2025.11.12.02.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Nov 2025 02:32:03 -0800 (PST) Date: Wed, 12 Nov 2025 11:32:01 +0100 From: Stefano Brivio To: Max Chernoff Subject: Re: pasta slow at HTTP upload Message-ID: <20251112113201.3bcabc6c@elisabeth> In-Reply-To: <20251112075548.0c05a25e@elisabeth> References: <176293029592.2033508.497353982367240204@maja> <20251112075548.0c05a25e@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lVTU5S8Lfp8rIlWJmpZ51btcYmihs_v0FKbWljLA_DE_1762943525 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="MP_/EA=iEBID_vtFx2iR/c3d1M_" Message-ID-Hash: HKI6XDJCCU32GIT4D5AVR5VGO5AOJB5Z X-Message-ID-Hash: HKI6XDJCCU32GIT4D5AVR5VGO5AOJB5Z X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-user@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: "For passt users: support, questions and answers" Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --MP_/EA=iEBID_vtFx2iR/c3d1M_ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, 12 Nov 2025 07:55:48 +0100 Stefano Brivio wrote: > Hi Max, > > On Tue, 11 Nov 2025 23:11:17 -0700 > Max Chernoff wrote: > > > Hi, > > > > For the past few months, I've noticed that my HTTP uploads from > > containers are really slow. Reproduction: > > > > [...] > > > > - The host that I ran this from is a VM in a datacenter, supposedly with > > a symmetrical 1Gb/s connection. Pinging github.com shows an RTT of > > 2ms, and pinging www.ctan.org shows an RTT of 100ms. > > Thanks for reporting this. Coincidentally, I'm currently debugging an > issue that looks similar to this, and I should have some patches for > you to test in a couple of days, I'll keep you posted. Hmm, actually, I have a hack that's not quite correct (we should make ACK_INTERVAL adaptive instead, which is one of the other bits I'm working on), but if it fixes the issue for you, it should at least mean that we're talking about the same issue. Patch attached. Can you give that a try? -- Stefano --MP_/EA=iEBID_vtFx2iR/c3d1M_ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=tcp_account_for_sendq_in_window.patch diff --git a/tcp.c b/tcp.c index e91c0cf..697f80d 100644 --- a/tcp.c +++ b/tcp.c @@ -339,7 +339,7 @@ enum { #define MSS_DEFAULT 536 #define WINDOW_DEFAULT 14600 /* RFC 6928 */ -#define ACK_INTERVAL 10 /* ms */ +#define ACK_INTERVAL 1 /* ms */ #define SYN_TIMEOUT 10 /* s */ #define ACK_TIMEOUT 2 #define FIN_TIMEOUT 60 @@ -1097,9 +1097,22 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn, if ((conn->flags & LOCAL) || tcp_rtt_dst_low(conn)) { new_wnd_to_tap = tinfo->tcpi_snd_wnd; } else { + uint32_t sendq; + int limit; + + ioctl(s, SIOCOUTQ, &sendq); tcp_get_sndbuf(conn); + + if ((int)sendq > SNDBUF_GET(conn)) + limit = 0; + else + limit = SNDBUF_GET(conn) - (int)sendq; + + if (limit < MSS_GET(conn)) + limit = 0; + new_wnd_to_tap = MIN((int)tinfo->tcpi_snd_wnd, - SNDBUF_GET(conn)); + limit); } new_wnd_to_tap = MIN(new_wnd_to_tap, MAX_WINDOW); @@ -1240,7 +1253,8 @@ int tcp_prepare_flags(const struct ctx *c, struct tcp_tap_conn *conn, th->fin = !!(flags & FIN); if (th->ack) { - if (SEQ_GE(conn->seq_ack_to_tap, conn->seq_from_tap)) + if (SEQ_GE(conn->seq_ack_to_tap, conn->seq_from_tap) && + conn->wnd_to_tap > MSS_GET(conn)) conn_flag(c, conn, ~ACK_TO_TAP_DUE); else conn_flag(c, conn, ACK_TO_TAP_DUE); --MP_/EA=iEBID_vtFx2iR/c3d1M_--