Skip to content

guestbd: serve the reads on a connection concurrently - #33

Merged
bradfitz merged 1 commit into
mainfrom
bradfitz/guestbd-concurrent
Dec 2, 2026
Merged

bradfitz merged 1 commit into
mainfrom
bradfitz/guestbd-concurrent

Conversation

@bradfitz

@bradfitz bradfitz commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

serveTransmission served one request at a time, so a client with many
requests in flight (QEMU's NBD client sends up to 16, Linux's more)
waited out each base image read in turn. Serve up to 32 reads on a
connection at once and reply as they finish, which NBD allows. Writes,
flushes and trims still wait for the reads before them.

For QEMU FreeBSD guests booting from a disk image on local disk with a
cold page cache, this takes guestbd from about 0.8s slower than QEMU's
own qcow2 to within noise of it.

Updates tailscale/corp#38609
Updates tailscale/corp#51705
Updates tailscale/corp#52010

@bradfitz
bradfitz requested a review from a team December 2, 2026 01:39

@runewake2 runewake2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bradfitz
bradfitz force-pushed the bradfitz/guestbd-concurrent branch from c2eb569 to 718377b Compare December 2, 2026 01:47
serveTransmission served one request at a time, so a client with many
requests in flight (QEMU's NBD client sends up to 16, Linux's more)
waited out each base image read in turn. Serve up to 32 reads on a
connection at once and reply as they finish, which NBD allows. Writes,
flushes and trims still wait for the reads before them. Read buffers
come from a sync.Pool, since reads no longer share one buffer.

For QEMU FreeBSD guests booting from a disk image on local disk with a
cold page cache, this takes guestbd from about 0.8s slower than QEMU's
own qcow2 to within noise of it.

Updates tailscale/corp#38609
Updates tailscale/corp#51705
Updates tailscale/corp#52010

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@bradfitz
bradfitz force-pushed the bradfitz/guestbd-concurrent branch from 718377b to d854fa7 Compare December 2, 2026 01:50
@bradfitz
bradfitz merged commit 9d232bf into main Dec 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants