Skip to content

Disk imports slow down and high coachroach usage #11673

Open

Description

@daberkow

While uploading disk images each transaction is chunked into 512KB chunks, perhaps to match the crucible/pantry backend.

The issue: doing some tracing it seems every 512KB chunk opens a new nexus transaction, leading to ~48 SQL queries. If we could increase the size at least the frontend accepts and then auth once, we could see greatly better speeds. With users wanting to upload 8GB or 100GB images, the current system can be slow and hits the DB very hard. Tests show around 6,300 SQL transactions a second at 64MB/s upload.

Currently there is a --parallelism flag in oxide.rs, which to the user speeds up the upload, but also just multiplies this issue.

There is a commend from several years ago that doing uploads in 512kb would be too expensive,

// The the disk state can change between the check above and here
// because there's no disk state change associated with this write.
// I believe that toggling the disk's state and generation number in
// the DB is too expensive to be done for every 512k chunk of a disk
// (or whatever the eventual import chunk size is), however I didn't
// actually measure it.

A trace on a dev box shows for a 512KB upload:

Process Share of busy CPU
CockroachDB 27%
Nexus 27%
Kernel threads (network, ZFS) 14%
softnpu 13%

Activity

  1. daberkow commented on Nov 3, 2026

    @daberkow
    Author
    Image Image Image Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions