public inbox for passt-user@passt.top
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Max Chernoff <git@maxchernoff.ca>
Cc: passt-user@passt.top
Subject: Re: pasta slow at HTTP upload
Date: Wed, 12 Nov 2025 11:32:01 +0100	[thread overview]
Message-ID: <20251112113201.3bcabc6c@elisabeth> (raw)
In-Reply-To: <20251112075548.0c05a25e@elisabeth>

[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

On Wed, 12 Nov 2025 07:55:48 +0100
Stefano Brivio <sbrivio@redhat.com> wrote:

> Hi Max,
> 
> On Tue, 11 Nov 2025 23:11:17 -0700
> Max Chernoff <git@maxchernoff.ca> 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

[-- Attachment #2: tcp_account_for_sendq_in_window.patch --]
[-- Type: text/x-patch, Size: 1336 bytes --]

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);

  reply	other threads:[~2025-11-12 10:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <176293029592.2033508.497353982367240204@maja>
2025-11-12  6:55 ` Stefano Brivio
2025-11-12 10:32   ` Stefano Brivio [this message]
2025-11-12 11:22     ` Max Chernoff
2025-11-12 12:53       ` Stefano Brivio
2025-11-13  0:30         ` Max Chernoff
     [not found]         ` <176301983731.2033508.12381101277059600955@maja>
2025-11-17  5:13           ` David Gibson
2025-11-23  9:12             ` Max Chernoff
2025-11-12  6:11 Max Chernoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251112113201.3bcabc6c@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=git@maxchernoff.ca \
    --cc=passt-user@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).