postgres-operator
postgres-operator copied to clipboard
Allow specifying hugepages resource requests & limits
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
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 any news? Would like to use this operator, but without huge-pages support not suitable.
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.
I thought someone was working on this issue
@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).