mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.75k stars 542 forks source link

High CPU use on sccache-dist client #928

Open mstange opened 3 years ago

mstange commented 3 years ago

Distributed compilation of mozilla-central on macOS causes very high CPU usage in the client's sccache process. I think this is a regression. I think it also slows down the build and underutilizes server resources but I haven't gathered evidence about that yet.

Some cursory profiling with Activity Monitor blames zero-initialization in a read_to_end function in tokio.

| 1623 _$LT$tokio_io..io..read_to_end..ReadToEnd$LT$A$GT$$u20$as$u20$futures..future..Future$GT$::poll::h0e3697daa2011f9b  (in sccache) + 43  [0x10b9e7fdb]
| + 1534 std::io::read_to_end::h934b6f944618f53e  (in sccache) + 152  [0x10b86bb48]
| + ! 1534 _platform_bzero$VARIANT$Haswell  (in libsystem_platform.dylib) + 41  [0x7fff2037a549]
glandium commented 3 years ago

I don't think it's a regression. CPU usage being too high is something that have been observed without distributed compilation, even, and some of it is covered in multiple issues filed by froydnj and njn a few months ago.

mstange commented 3 years ago

Ok. I was mostly going by fan noise. I thought in the past my server machine was louder than my Macbook Pro during compilation, and that's no longer the case, but I could definitely be wrong.