-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Add memory-swap and memory-swappiness support to v3 since it was available in v2 #7594
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it had not recent activity during the stale period. |
I will never understand people adding the stale bot. Just because there's no replies, doesn't mean the problem has magically gone away. |
This is important. Do it! |
@crowley666x |
I guess you are referering to this part in the doc : https://docs.docker.com/compose/compose-file/05-services/#mem_swappiness I find it a little odd that the other resources options are under the
And it is not clear where this I also think that a note could be added in here to specify that swap options are not at the deploy level, but at the service level |
So memswap_limit isn't deprecated as the docs say because v2 and v3 was merged? |
Just noting that this is still confusing and underdocumented. |
It doestn't work. If I specify it under service level:
And if I put it there:
memswap_limit is not allowed as well. also : services.my_srv.deploy.resources Additional property memswap_limit is not allowed |
Is your feature request related to a problem? Please describe.
You can configure
memswap_limit
andmem_swappiness
in v2 compose files.Docs (https://docs.docker.com/compose/compose-file/#resources) claim v3 replaces these settings with
deploy: resources:
.These docs are very misleading, these swap settings simply cannot be configured in v3 format.
Describe the solution you'd like
First, please make the current situation clear in the docs. These docs cause so much unnecessary confusion like:
https://forums.docker.com/t/memory-swap-vs-memory-swappiness-and-using-in-docker-compose/54889
https://stackoverflow.com/questions/44325949/how-to-replace-memswap-limit-in-docker-compose-3
If the answer as @shin- seemed to indicate is to keep using v2, then make it clear that v3 format is not needed and should not be used if you (very reasonably) want to configure swap settings for your services.
But really I'd like docker-compose to make the v3 format a complete replacement of v2, anything you could configure in v2 (or with
docker run
) should be available in v3. Also--compatibility
should be default behavior.Describe alternatives you've considered
Switch back to v2 format? I'm not using docker swarm so I guess I could try but I'd like to deploy to k8s eventually.
Additional context
The problem I'm running into is that some services are using a lot of swap. I know I should probably disable swap on the host server but not always possible/easy.
This is mostly the same issue as #4513 but hopefully you will reconsider now that you're taking a fresh look at compose.
The text was updated successfully, but these errors were encountered: