-
Notifications
You must be signed in to change notification settings - Fork 48
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
docker-compose.yml: make it easy to restrict db resources #4986
Conversation
As we learned, postgres may behave differently depending on the available RAM. You can now test the database nearer to production by adding DB_MEMORY_LIMIT=1G DB_CPU_LIMIT=1 to your .env file. IntelliJ does not like the env variable interpolation, but it works. I used 128G as fallback, because normally while developing you don't want a slow DB. With the cpus it was not possible to limit to more cpu than the machine has. Thus, i limited to 8 cores which every developer machine has hopefully.
67fda36
to
45a9d4b
Compare
@BacLuc |
This is only for docker compose, and has nothing to do with kubernetes. |
well
but if i connect to the container, it looks like there are more resources availlable: CPU: Memory:
Are these information not reliable? |
I also don't see a change in /proc/cpuinfo or with free. |
Not sure I am happy with developers having to do more setup to get eCamp up and running locally (manually entering the number of cores and amount of memory into their .env). And also I'm not sure I like the statement "8 cores which every developer machine has hopefully". Could we instead add this commented out into docker-compose.yml, and if I want to restrict the db resources, I can uncomment it and tweak the values? |
They don't have do do anything as long as they have 8 or more cores, and are happy with the 8 cores that are running the db. I am not a fan of changes to checked in files that you want different on your machine and accidentally check in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your arguments convinced me. Thanks!
As we learned, postgres may behave differently depending on the available RAM.
You can now test the database nearer to production by adding
DB_MEMORY_LIMIT=1G
DB_CPU_LIMIT=1
to your .env file.
IntelliJ does not like the env variable interpolation, but it works.
I used 128G as fallback, because normally while developing you don't want a slow DB.
With the cpus it was not possible to limit to more cpu than the machine has. Thus, i limited to 8 cores which
every developer machine has hopefully.