postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Allow specifying hugepages resource requests & limits

Open adamcharnock opened this issue 3 years ago • 1 comments

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

adamcharnock avatar Feb 18 '22 20:02 adamcharnock

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

rghdrizzle avatar Aug 16 '22 08:08 rghdrizzle

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

Sapp00 avatar Feb 20 '23 23:02 Sapp00

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.

Jan-M avatar Feb 24 '23 23:02 Jan-M

I thought someone was working on this issue

rghdrizzle avatar Feb 25 '23 04:02 rghdrizzle

@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).

Sapp00 avatar Mar 03 '23 23:03 Sapp00