Skip to content
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

fix(pipelinetriggers): process mptv2 pipelines in parallel #1113

Merged
merged 16 commits into from
Jan 5, 2022
Merged

fix(pipelinetriggers): process mptv2 pipelines in parallel #1113

merged 16 commits into from
Jan 5, 2022

Conversation

robert-blackman
Copy link
Contributor

@robert-blackman robert-blackman commented Jul 28, 2021

Hey

Several months ago we came across this issue whereby a large number of MPTv2 pipelines seemed to have a significant (negative) performance impact on pipeline triggers. Initial investigation indicated this was due to how the pipelines were planned. We originally developed a poc plan cache, this worked quite well however the scope of the fix grew as we discovered more code paths that called on the hydration method.

This fix takes a simpler approach by streaming the pipelines in parallel to orca for planning. This is implemented through the use of a ForkJoinPool using a custom parallelism argument, Runtime.getRuntime().availableProcessors() by default. We decided to use a ForkJoinPool over a cached thread pool due to its lower memory footprint and work stealing virtues.

The parallelism argument can be configured via the following spring config within the echo-local profile:

pipelineCache:
  parallelism: 128 # We are using this in production

Would be great to get some feedback on this. Thanks!

Fixes this issue

@spinnakerbot
Copy link
Contributor

The following commits need their title changed:

Please format your commit title into the form:

<type>(<scope>): <subject>, e.g. fix(kubernetes): address NPE in status check

This allows us to easily generate changelogs & determine semantic version numbers when cutting releases. You can read more about commit conventions here.

@robert-blackman
Copy link
Contributor Author

Hey @dreynaud, just tagging you here for visibility 👍

.collect(Collectors.toList()))
.get();
} catch (InterruptedException | ExecutionException e) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to either log or throw the exception here, no? Not sure what the implication of returning null is here, are we sure the consumers are ok with it?

Copy link
Contributor Author

@robert-blackman robert-blackman Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dreynaud Good point, perhaps it's best to log the exception for visibility, then return an empty list which should match the existing behaviour?

@dreynaud
Copy link
Contributor

Hey @dreynaud, just tagging you here for visibility 👍

Looks like a good change @robert-blackman 👍 Just see my other comment around the exception handling, otherwise LGTM

Also tagging @robzienert 👀

@mattgogerly mattgogerly added the ready to merge Approved and ready for merge label Dec 6, 2021
@mattgogerly
Copy link
Member

@Mergifyio update

@link108
Copy link
Member

link108 commented Dec 20, 2021

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Dec 20, 2021

update

❌ Pull request can't be updated with latest base branch changes

Mergify needs the author permission to update the base branch of the pull request.
monster-next needs to authorize modification on its head branch.
err-code: 09B30

@link108
Copy link
Member

link108 commented Dec 20, 2021

Hey @robert-blackman, do you mind allowing changes from maintainers on this PR? Eg https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork

@mergify mergify bot added the auto merged label Dec 20, 2021
@mergify mergify bot merged commit 703d620 into spinnaker:master Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Large number of MPTv2 Templated Pipelines causes slow hydration/planning
6 participants