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

Document Kubernetes limits and requests for Garnet #1022

Open
mloskot opened this issue Feb 14, 2025 · 6 comments
Open

Document Kubernetes limits and requests for Garnet #1022

mloskot opened this issue Feb 14, 2025 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@mloskot
Copy link
Contributor

mloskot commented Feb 14, 2025

Feature request type

enhancement

Is your feature request related to a problem? Please describe

The official Helm chart includes an example of the resources limits/requests:

# -- Resources
resources: {}
# limits:
# cpu: 200m
# memory: 64Mi
# requests:
# cpu: 10m
# memory: 16Mi

but, there is no explanation of those are defaults or recommended values or just 'syntactical' placeholders.

Describe the solution you'd like

At least a suggestion of minimum and recommended limits/requests should be documented to give users an idea, bearings.

Ideally, if Garnet's chart could specify the resources requirements with pre-defined presets like this chart does it for Redis providing
none, nano, micro, small, ... presets:
https://github.com/bitnami/charts/blob/a401c96b685d790344f960eab46e5aba87308f63/bitnami/common/templates/_resources.tpl#L15-L44

Describe alternatives you've considered

Trial and error using the limits from the comment above:

Image

Additional context

@badrishc
Copy link
Collaborator

badrishc commented Feb 26, 2025

I am not sure how we can choose the best presets up front as this is highly workload dependent. You have to decide how to partition your total available memory across: (1) main store index; (2) main store log; (3) object store index; (4) object store log; (5) object store heap size; (6) AOF size in memory. These decisions are based on various workload-level attributes such as number of keys indexed, whether the workload is mostly strings or objects, whether AOF is enabled, etc.

I suppose we could make some rough assumptions and allocate accordingly. We don't really work with Helm charts actively, but if anyone in the community wants to take a stab at this, feel free to contribute.

@mloskot
Copy link
Contributor Author

mloskot commented Feb 26, 2025

@badrishc Thank you for your response.
It is clear to me that an administrator is supposed to tune Garnet parameters. What I suggest is to provide some required or reasonable defaults. Perhaps Garnet could apply rationale similar to this bitnami/charts#23410

While it is true that this is a task of the operator to adapt the resources to their use case, we do not explicitly mention in our documentation that a deployment without resources is not recommended for production.
(...) a set of presets (nano, micro, small...), which will be configured in our charts by default to the smallest size that works in our testing.

The defaults could help Garnet users like myself, when I initially tried simplest storage-less test deployment of Garnet using resources based on Redis nano preset:

Image

eventually realising it needs at least equivalent of small.

@badrishc
Copy link
Collaborator

cc @babykart - is this something of interest to make available for garnet?

@babykart
Copy link
Contributor

@badrishc I think the helm chart provides the bare minimum, that is, the ability to adjust these values. As you said, it is very difficult to provide templates where so many parameters are dependent of the real workload.
The fact that the limits/requests are not activated by default allows the pod to launch regardless of the setting. It is up to the user/cluster administrator to set the appropriate values ​​for their use cases.
If we want to provide an example, it would be appropriate to adjust it to the default values ​​when garnet is not configured and a link to the part of the documantion that explains how to calculate the correct values. In my opinion, enabling them by default will generate issues/tickets while the user is responsible for its use and the resources he is willing to commit.

@mloskot
Copy link
Contributor Author

mloskot commented Mar 13, 2025

@babykart

to provide an example, it would be appropriate to adjust it to the default values ​​when garnet is not configured and a link to the part of the documantion that explains how to calculate the correct values

That would be of great help indeed, bearings that users may need.

enabling them by default will generate issues/tickets

Yes, good point. Redis, I understand, provides the named presets as a suggestion (and documentation) of reasonable defaults, but does not force to use it.

@badrishc badrishc added the help wanted Extra attention is needed label Mar 18, 2025
@badrishc
Copy link
Collaborator

That would be of great help indeed, bearings that users may need.

If someone makes a draft PR for this, I will be happy to suggest what the specific values should be for the default case. The doc link would be this: https://microsoft.github.io/garnet/docs/getting-started/memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants