-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialized MD5 calls slow down ∅ builds #1210
Comments
Try using |
(that's a startup flag so it should be used before build and works only on server mode) |
With
Even if that did help, wouldn't it just bypass the problem for null builds? Wouldn't the serialization still affect any other build? |
Wait 5s for a null build with watchfs? For the MD5 lock, you might be interested in cl/113053143 (internal reference), there is a long discussion about that, I am unsure what was the result. |
As an update, I've found that the middle-ground actually works better. Completely eliminating the lock does slow builds with a large number of changes (also ends up with a lot of "slow read" log messages). However, turning the lock into a semaphore with 20 (just some number) permits worked pretty well for both the null build and a clean build. Maybe a flag could be added to tune the number with a default larger than 1. |
Consider seeding the semaphore with the min of the number of disk IO credits available or cores * 1.5. |
Could you please check if this flag helps and report back? :) The MD5 lock is bypassed with the flag set - I agree that using a Semaphore would be even better. I can have a look at this if you think this is going into the right direction. |
Thanks for the progress! 👍 Full build w/o flag: Full build w/ flag: Looks like what I saw with my first change. Builds with lots of changes slow down slightly and builds with few changes perform better. |
Is there a plan for making this less experimental? I doubt we're going to see the extended filesystem md5 attribute out here in the wild anytime soon... |
@werkt We could enable this by default if we had a reliable way of detecting whether the workspace and output_base are on an SSD... any idea? |
For Linux, once you figure out what filesystem they're on, |
Why was this closed? We're also noticing this issue, as of 0.16 |
@dapirian Could you please try with the |
#1042, #923, and #835 are running into the same problem from different perspectives. I'm adding this issue for the core problem in Bazel: it serializes hashing artifacts larger than 4K.
Even setting up Bazel for success with no changes at all, Kythe's build is rather slow because of this (we have quite a few large >4K artifacts):
The suggestion to use
--noexperimental_check_output_file
(from #923) does not improve this situation:However, if I rebuild Bazel to remove the synchronization on the
MD5_LOCK
inDigestUtils.java
, the null build is much nicer:The reasoning for this serialization in
DigestUtils.java
does not seem to universally apply (as stated in #835 and made apparent with the above experiment):As for a solution, here's my two cents. If there is evidence that the serialization does benefit some builds, then I would like to see a flag to adjust this on a per machine case (with
.bazelrc
) or maybe have Bazel figure it out on its own if it can. If there isn't any evidence that the serialization helps, then perhaps it's time to remove it altogether.The text was updated successfully, but these errors were encountered: