Skip to content

Slow cache, 25 seconds before anything is printed

Summary

When running any command that creates a pipeline, BuildStream takes 25 seconds before anything happens.

  • My cache is 51G.
  • I have an NVMe SSD disk.
  • It does not matter if I call it again and again.

Steps to reproduce

Just populate the cache. And try to run any command.

What is the current bug behavior?

It takes 25s on a high end desktop.

What is the expected correct behavior?

It should take 250 time less time.

Relevant logs and/or screenshots

Possible fixes

Short term fix

du takes .8 seconds to scan cas, but around 12 seconds to scan extract. Since all files are in extract are also in cas, skipping it would only miss the size of directories, which we would be OK to neglect given the speedup we get.

However we can only do that when #561 (closed) is fixed.

  1. Get #561 (closed) fixed.
  2. Skip scanning of extract directory.

Long term fix

Ideally we would do book keeping.

  • Fix #573 (closed), we will keep the size in memory and update it incrementally (question do we still need to stat both cas and extract?)
  • Fix cache management with multiple instances running concurrently (#585)
  • Make sure we share cache size on disk across instances (mmap'ed file?)

Other relevant information


Edited by Valentin David
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information