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

Make profile specific context paths optional to improve performance #787

Closed
DanielYWoo opened this issue Jun 9, 2022 · 1 comment · May be fixed by #788
Closed

Make profile specific context paths optional to improve performance #787

DanielYWoo opened this issue Jun 9, 2022 · 1 comment · May be fixed by #788

Comments

@DanielYWoo
Copy link

DanielYWoo commented Jun 9, 2022

Is your feature request related to a problem? Please describe.
Provide a flag to disable profiles. e.g., currently we always have a default profile appended, so typically we watch 4 paths for a normal application:

config/testApp,default/
config/testApp/
config/application,default/
config/application/

In our deployments we have 40+ data centers to support 150M users, we have so many requests to Consul that we have to keep it lean, and we want to remove the profile-specific paths and only keep two of them:

config/testApp/
config/application/

Describe the solution you'd like
After reading the source code it seems we can do it in ConsulPropertySources.generateAutomaticContexts(...) to skip the calls to addProfiles().
I propose to have a flag likespring.cloud.consul.config.profileEnabled, and default to true to keep it compatible with the current behavior. e.g.,

if (properties.isProfileEnabled()) {
    for (String suffix : suffixes) {
        addProfiles(contexts, defaultContext, profiles, suffix);
    }
}

Describe alternatives you've considered
We can tune waitTime and delay to make our services have less pressure on Consul, but it sacrifices the latency, and we still want to detect changes fast enough. By removing the profiles we can get rid of 50% of unnecessary traffic to Consul, which sounds like a low-hanging fruit. If you agree with this option, I can raise a PR.

Additional context
N/A

@spencergibb
Copy link
Member

Closing in favor of #788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants