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 issues with postgresql, K8s, and transparent huge pages #2355

Open
jdevries3133 opened this issue Jul 30, 2023 · 1 comment
Open

Comments

@jdevries3133
Copy link

PostgreSQL, K8s, and transparent huge pages do not play nice together; there are several open issues discussing the exact details here;

docker-library/postgres#946

docker-library/postgres#451 (comment)

It took me a very long time to figure out the workarounds that I've documented (mostly for my own sake) in https://github.com/jdevries3133/homelab_cluster/tree/main/postgres_hello_world.

I realize there are some docs about how to configure PostgreSQL in general (https://github.com/docker-library/docs/tree/master/postgres#database-configuration). I think it would be good to add a sub-section about this problem. As I understand it (and I think I may be wrong, to some extent), the problem is:

  • containerd (and maybe other container runtimes) are unable to provide hugepages to containers
  • nonetheless, PostgreSQL is configured to "try" to use transparent hugepages
  • although transparent hugepages cannot really be provided, in this context, postgres somehow internally comes to believe that it has access to transparent hugepages
  • ???
  • segmentation fault

And, therefore, the solution I have come to is (maybe) to disable transparent hugepages on the underlying K8s nodes and to also to disable transparent hugepages in PostgreSQL configuration.

To conclude: I have some ubuntu server nodes. I do some kubeadm cluseter. I try to use PostgreSQL. PostgreSQL no work. Seems like this is a typical enough pattern we should try to make it stink less if possible!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants