Skip to content

Allow specifying hugepages resource requests & limits #1788

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

Closed
adamcharnock opened this issue Feb 18, 2022 · 5 comments · Fixed by #2311
Closed

Allow specifying hugepages resource requests & limits #1788

adamcharnock opened this issue Feb 18, 2022 · 5 comments · Fixed by #2311

Comments

@adamcharnock
Copy link

adamcharnock commented Feb 18, 2022

Currently it is only possible to specify cpu and memory limits. Given Kubernetes has Huge Page Support, and huge pages are very applicable to databases, I suggest that it would be useful to be able to do the following:

    resources:
      limits:
        cpu: 1
        memory: 1024Mi
        hugepages-2Mi: 1024Mi
      requests:
        cpu: 100m
        memory: 1024Mi
        hugepages-2Mi: 1024Mi

Or the equivalent with hugepages-2Gi.

I think all this would require is passing this information through to the stateful set. However, I'm happy to be corrected.

The volumes could then be mounted using the existing additionalVolumes option. I think something like this would work:

        additionalVolumes:
          - name: hugepages-2Mi
            mountPath: /hugepages-2Mi
            volumeSource:
              emptyDir:
                medium: HugePages-2Mi
@rghdrizzle
Copy link

Hey I would like to work on this issue . I am new to this community and also to Open source . Looking forward to contribute

@Sapp00
Copy link

Sapp00 commented Feb 20, 2023

@rghdrizzle any news?
Would like to use this operator, but without huge-pages support not suitable.

@Jan-M
Copy link
Member

Jan-M commented Feb 24, 2023

Would be open for a PR sure. Also curious about the positive impact.

Ideally though the user should not specify it? Does it make sense not to match the memory limit/request for Postgres? Thus operator should set it in relation to memory request but can allow overwrite.

@rghdrizzle
Copy link

I thought someone was working on this issue

@Sapp00
Copy link

Sapp00 commented Mar 3, 2023

@Jan-M regarding the impact: https://www.percona.com/blog/benchmark-postgresql-with-linux-hugepages/

In general I would also leave it as disabled per default. Regarding setting it via operator - I always set it to the mem limit as you suggested, but I am no PGres expert. But would be awesome if your operator would support both (dynamic and fixed setting).

silenium-dev added a commit to silenium-dev/postgres-operator that referenced this issue Apr 28, 2023
@FxKu FxKu closed this as completed in #2311 Jan 4, 2024
FxKu added a commit that referenced this issue Jan 4, 2024
… to the statefulset (#2311)

* Add hugepages-2Mi and 1Gi to ResourceDescription type and crd (#1549, #1788)
* Add tests for hugepages resource requests/limits
* Add tests for hugepages resource requests/limits on sidecars, too
* Add docs for hugepages support
* Add link to kubernetes docs on hugepages
* Add tests for hugepages not being set on container if not requested in custom resource
* Add hugepages resources fields to manifest docs
* Add hugepages resources fields to complete manifest example
* Add hugepages resources fields to chart crd

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants