[v7r2] Add environment variable to speed up the CS#5185
Merged
Conversation
chrisburr
marked this pull request as ready for review
June 8, 2021 09:30
andresailer
reviewed
Jun 8, 2021
Co-authored-by: Andre Sailer <andre.philippe.sailer@cern.ch>
chrisburr
force-pushed
the
less-cs-locking
branch
from
June 8, 2021 10:15
a122817 to
a123333
Compare
Contributor
|
Do you know why the docs are failing? |
andresailer
reviewed
Jun 11, 2021
Contributor
|
For the docs test: I think there was a problem with the infrastructure downloading a package, but we can't re-run those PR builds manually |
Co-authored-by: Andre Sailer <andre.philippe.sailer@cern.ch>
Member
Author
|
Yeah it was hit by the fastly outage earlier this week which brought down half the internet: https://www.fastly.com/blog/summary-of-june-8-outage |
atsareg
approved these changes
Jun 13, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When profiling the production agents/services in LHCb I've notice that a significant amount of time is spent waiting for one of the three locks in the CS. This change can make both single and multithreaded code that heavily uses the CS significantly faster (hard to measure/define but I've seen 2x in single threaded and 4x in multithreaded when testing).
While I can see why the locks are put in place in the CS I think they're actually implemented in such a way that they're not that useful while having a big impact on the overall CS performance.
Additionally, the "dangerZone" locks have been broken for the last 12 years as the
disableDangerZonesoption still decrements the thread count causing the thread count to go negative and never be respected properly (potentially fixed by #5183 but I think it's better just to get rid of the locks):As this change obviously has the potential to cause problems, @chaen suggested using an environment variable to allow this to be quickly enabled/disabled in v7r2.
I also add a cache on the value of
gConfigurationData.getRefreshTime()as it's accessed at least once for every CS operation.See also: DIRACGrid/diraccfg#5
BEGINRELEASENOTES
*Configuration
NEW: Add DIRAC_FEWER_CFG_LOCKS environment variable to significantly improve multithreading performance in CS heavy workloads
ENDRELEASENOTES