Skip to content

Relatively high CPU usage on measly 70 MB/s replication write throughput #268

@joonas-fi

Description

@joonas-fi
Image

Reads amount to ~ 70 MBs, so do writes (symmetric because we write what we read). We are only doing CRC32 (IEEE) during replication:

expectedCrc32, err := d.metadataStore.QueryBlobCrc32(ref)
if err != nil {
return fmt.Errorf("Replicate() QueryBlobCrc32: %v", err)
}
rawContent, err := fromDriver.RawFetch(ctx, ref)
if err != nil {
return err
}
defer rawContent.Close()
crc32VerifiedReader := hashverifyreader.New(rawContent, crc32.NewIEEE(), expectedCrc32)
if err := toDriver.RawStore(ctx, ref, crc32VerifiedReader); err != nil {
return err
}
return d.metadataStore.WriteBlobReplicated(ref, toVolumeID)

CPU usage averages to 55 % across all cores. We should be expected to get 1,000 to 5,000+ MB/s per core on an AMD Ryzen 5 2400G (claimed by ChatGPT), so CPU usage really shouldn't be much above base load during replication.

There's something funky going on, my hunch is that it's the DB doing a write transaction per every blob replicated. 70 MB/s should equal to 18 blobs a second, therefore 18 write txns a second - assuming 4 MB blobs on average for my data set. This should be peanuts for any DB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions