Re: [PATCH 1/1] nbd/server: push pending frames after sending reply

2023-03-27 Thread Kevin Wolf
Am 24.03.2023 um 11:47 hat Florian Westphal geschrieben: > qemu-nbd doesn't set TCP_NODELAY on the tcp socket. > > Kernel waits for more data and avoids transmission of small packets. > Without TLS this is barely noticeable, but with TLS this really shows. > > Booting a VM via qemu-nbd on localho

Re: [Libguestfs] [PATCH 1/1] nbd/server: push pending frames after sending reply

2023-03-24 Thread Florian Westphal
Eric Blake wrote: > On Fri, Mar 24, 2023 at 02:41:20PM -0500, Eric Blake wrote: > > On Fri, Mar 24, 2023 at 11:47:20AM +0100, Florian Westphal wrote: > > > qemu-nbd doesn't set TCP_NODELAY on the tcp socket. > > Replying to myself, WHY aren't we setting TCP_NODELAY on the socket? If the applicat

Re: [Libguestfs] [PATCH 1/1] nbd/server: push pending frames after sending reply

2023-03-24 Thread Eric Blake
On Fri, Mar 24, 2023 at 02:41:20PM -0500, Eric Blake wrote: > On Fri, Mar 24, 2023 at 11:47:20AM +0100, Florian Westphal wrote: > > qemu-nbd doesn't set TCP_NODELAY on the tcp socket. Replying to myself, WHY aren't we setting TCP_NODELAY on the socket? > > And surprisingly, qemu IS using corking

Re: [PATCH 1/1] nbd/server: push pending frames after sending reply

2023-03-24 Thread Eric Blake
On Fri, Mar 24, 2023 at 07:20:17PM +0100, Florian Westphal wrote: > Kevin Wolf wrote: > > Am 24.03.2023 um 11:47 hat Florian Westphal geschrieben: > > > +qio_channel_set_cork(client->ioc, true); > > > + > > > if (ret < 0) { > > > /* It wasn't -EIO, so, according to nbd_co_receive

Re: [PATCH 1/1] nbd/server: push pending frames after sending reply

2023-03-24 Thread Eric Blake
On Fri, Mar 24, 2023 at 11:47:20AM +0100, Florian Westphal wrote: > qemu-nbd doesn't set TCP_NODELAY on the tcp socket. > > Kernel waits for more data and avoids transmission of small packets. > Without TLS this is barely noticeable, but with TLS this really shows. > > Booting a VM via qemu-nbd o

Re: [PATCH 1/1] nbd/server: push pending frames after sending reply

2023-03-24 Thread Florian Westphal
Kevin Wolf wrote: > Am 24.03.2023 um 11:47 hat Florian Westphal geschrieben: > > +qio_channel_set_cork(client->ioc, true); > > + > > if (ret < 0) { > > /* It wasn't -EIO, so, according to nbd_co_receive_request() > > * semantics, we should return the error to the client

Re: [PATCH 1/1] nbd/server: push pending frames after sending reply

2023-03-24 Thread Kevin Wolf
Am 24.03.2023 um 11:47 hat Florian Westphal geschrieben: > qemu-nbd doesn't set TCP_NODELAY on the tcp socket. > > Kernel waits for more data and avoids transmission of small packets. > Without TLS this is barely noticeable, but with TLS this really shows. > > Booting a VM via qemu-nbd on localho

[PATCH 1/1] nbd/server: push pending frames after sending reply

2023-03-24 Thread Florian Westphal
qemu-nbd doesn't set TCP_NODELAY on the tcp socket. Kernel waits for more data and avoids transmission of small packets. Without TLS this is barely noticeable, but with TLS this really shows. Booting a VM via qemu-nbd on localhost (with tls) takes more than 2 minutes on my system. tcpdump shows