Bazel is performing very well with --spawn_strategy=local, and poorly when using sandboxing for C++. I have a dual socket, 16 core desktop with a PCIE solid state drive. The hardware is fast.
I have the following in my bazelrc file: build --local_resources 50000,16,1000
top shows a bunch of sandbox tasks who all add up to about 1 CPU worth of load, and sometimes some other tasks which run faster.
iotop shows that when bazel is reading from disk from Java, I get 600% CPU usage or more, and 100+ MB/s of disk activity.
atop shows that when it is building, we are limited on the filesystem. The relevant line is "LVM | oot-root--lv | | | busy 94% | | read 1 | | | write 13307 | | | KiB/r 4 | | KiB/w 9 | | | MBr/s 0.00 | | | MBw/s 12.85 | | avq 52.62 | | | avio 0.70 ms |"
For a solid state drive, 12.8 MB/s at 94% IO usage is pretty bad.
The build takes significantly longer when running sandboxed. I am using the compiler from a .tar.gz in the sandbox and using a custom crosstool.
Any ideas on what is wrong? Is there anything I can collect to help debug this?
Thanks,
Austin