Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

[Elasticsearch] Default values for resource policies makes it hard to have unset limits #409

Closed
rccrdpccl opened this issue Dec 12, 2019 · 5 comments
Labels
enhancement New feature or request won't fix This will not be worked on

Comments

@rccrdpccl
Copy link
Contributor

Describe the feature: Set empty object as default value for resource policy for elasticsearch containers

Describe a specific use case for the feature: Often it is quite useful to have applications running without limits in its resource policy (for example, setting CPU limits causes throttling CPU time). At the moment is not easy to unset default values, forcing the user to set limits.

@jmlrt jmlrt added the enhancement New feature or request label Dec 18, 2019
@jmlrt
Copy link
Member

jmlrt commented Jan 20, 2020

Hi @rccrdpccl & @pbecotte,

We may rediscuss internally but I think our policy is to always set a default value for requests/limits in our chart to ensure this meets production criterias.

I think it was already discussed in an issue or PR but can't find the link.

Meanwhile, despite I'm not sure we'll want to merge #445, using --set resources=null allows you to disable default resources requests/limits (--set resources.limits=null to disable only limits).

@rafael-romero-carmona-claranet

Hello @jmlrt it is not recommended to set CPU limits but to use request to assure at least what each pod needs. If you add limits and your pod needs more CPU it could be a problem instead of anything useful.

Some docs

@jmlrt
Copy link
Member

jmlrt commented Jan 23, 2020

Hi @rafael-romero-carmona-claranet,

There is documentation mentioning that in some use cases add CPU limits can increase latency because of throttling (here, here, and here for example), this seem partly fixed with 5.4 kernel by torvalds/linux@de53fd7aedb1 and torvalds/linux@763a9ec06c40 and I didn't find a current state of this issue (most of the link about this issue are dated from the end of 2018 or begining of 2019).

In the other way, at Elastic, we have a strong opinion that memory request should always be equals to memory limits for Elasticsearch. As for CPU limits, we also recommend setting CPU request = CPU limits (this is currently not the case in default value and I'll add a PR soon to fix it) to ensure that performance stay consistent and we don't run into performance problems because another pod is suddenly using more cpu.

Please keep in mind that the default values we provide are the ones we recommend for most general use cases to ensure that a deployment with default values match our production criterias in term of consistent performance and availability in most case.

However anyone having more critical performance needs should still have a testing and tunning phase and override the default values with the ones that fits better for its specific use case.

That's why default values are overridable.

@pbecotte
Copy link
Contributor

Fair enough. Helm recommends -not- setting defaults, so it actually came as somewhat of a suprise to me when I realized that they were set here. I am not sure I 100% agree with that recommendation though, so if you feel strongly about it please feel free to close as a won't fix :)

@rafael-romero-carmona-claranet

Thanks for the answer @jmlrt
I agree with @pbecotte

@jmlrt jmlrt added the won't fix This will not be worked on label Jan 31, 2020
@jmlrt jmlrt closed this as completed Jan 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request won't fix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants