ImportAll work queue manager to import items in parallel in some situations#970
Open
raymond-rebbeck wants to merge 2 commits into
Open
ImportAll work queue manager to import items in parallel in some situations#970raymond-rebbeck wants to merge 2 commits into
raymond-rebbeck wants to merge 2 commits into
Conversation
…o improve performance Currently only used when not compiling. When compiling the pull event handler is used which will require a different work queue manager implementation.
…mposed productions are in use It seems very likely that there would be race conditions within ImportItem without further locking being implemented to ensure that productions are created and updated safely.
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.
Description
Import All is currently all done in a single thread and with a large codebase this becomes a bottleneck as for example it can take 10+ minutes to import to import 6000+ files. We have a CI/CD pipeline where we use
ImportAlldozens a times a day andImportAllis the step that currently takes the most time.We do not use
compileOnImportordecomposeProductionsat all and so the scope has purposely been limited to only cover when those options are not being used. In this case it seems to be relatively straightforward to apply a work queue manager so thatImportItemis performed in parallel.This has yielded significant improvements with importing being 3-4 times faster. When system processes are observed using
topmultipleirisdbproceses are observed churning away with high CPU usage (as expected), rather than only a single process prior.It is very likely possible to re-factor
ImportRoutinesso that more can be done in parallel but the current code structure makes it straightforward to apply this toImportItemwhich seems to be where most of the heavy lifting is currently done anyway and so likely the most benefit derived.To allow a work queue manager to be used with
compileOnImportwould probably require a separate implementation within the pull event handler itself, which is not planned as part of this work due to not using this setting. To use withdecomposeProductionswould probably require additional locking to be implemented inImportItemto allow productions to be created and updated safely, also not planned as part of this due to not using this setting - it is conceivable that such a thing may help with #917 .Testing
Tested manually with a codebase that consists of 6000+ files (includes types
.cls,.hl7,.incand.lut), importing all from scratch (i.e. fresh empty IRIS container) and subsequent Import All (Force) over the top repeatedly. With and withoutcompileOnImportanddecomposeProductionsenabled to check that work queue manager is and isn't being used as expected. Compiling all classes and running unit tests without any expected issues after work manager import all.Checklist
mainbranch rebased or merged.git-webui/srchave matching changes ingit-webui/release)