cli/compose: memswap_limit -> memory_swap, mem_swappiness -> memory_swappiness#6638
cli/compose: memswap_limit -> memory_swap, mem_swappiness -> memory_swappiness#6638thaJeztah wants to merge 1 commit intodocker:masterfrom
Conversation
|
@ndeloof I'm guessing the naming originated from what was already in the compose-spec at a different place; Would there be a motivation to align with those, or just go with this one? ## mem_swappiness
`mem_swappiness` defines as a percentage, a value between 0 and 100, for the host kernel to swap out
anonymous memory pages used by a container.
- `0`: Turns off anonymous page swapping.
- `100`: Sets all anonymous pages as swappable.
The default value is platform specific.
## memswap_limit
`memswap_limit` defines the amount of memory the container is allowed to swap to disk. This is a modifier
attribute that only has meaning if [`memory`](deploy.md#memory) is also set. Using swap lets the container write excess
memory requirements to disk when the container has exhausted all the memory that is available to it.
There is a performance penalty for applications that swap memory to disk often.
- If `memswap_limit` is set to a positive integer, then both `memory` and `memswap_limit` must be set. `memswap_limit` represents the total amount of memory and swap that can be used, and `memory` controls the amount used by non-swap memory. So if `memory`="300m" and `memswap_limit`="1g", the container can use 300m of memory and 700m (1g - 300m) swap.
- If `memswap_limit` is set to 0, the setting is ignored, and the value is treated as unset.
- If `memswap_limit` is set to the same value as `memory`, and `memory` is set to a positive integer, the container does not have access to swap.
- If `memswap_limit` is unset, and `memory` is set, the container can use as much swap as the `memory` setting, if the host container has swap memory configured. For instance, if `memory`="300m" and `memswap_limit` is not set, the container can use 600m in total of memory and swap.
- If `memswap_limit` is explicitly set to -1, the container is allowed to use unlimited swap, up to the amount available on the host system. |
…wappiness Align the names in the compose / stack schema with the command-line flags, instead of aligning with the existing options in the compose-schema (which I think originated from v1); https://github.com/compose-spec/compose-spec/blob/a08f8d51631b7127ddac3d2c65537db429d0f1d0/spec.md?plain=1#L1440-L1461 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
282839c to
75b7e23
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ndeloof
left a comment
There was a problem hiding this comment.
Doing so would break backward compatibility with earlier compose files
Why change the compose file syntax, to align with flags just introduced and not yet release ? Those flags could be renamed to match existing compose attributes (introduced by docker/compose@d824cb9)
|
The flags align with the ones on And The new ones are on |
|
oh indeed, I guess it's to late to complain on docker/compose#2383 that the compose attribute should align with CLI flags 🥲 |
|
Thanks, @thaJeztah, for doing this. |
Align the names in the compose / stack schema with the command-line flags, instead of aligning with the existing options in the compose-schema (which I think originated from v1);
https://github.com/compose-spec/compose-spec/blob/a08f8d51631b7127ddac3d2c65537db429d0f1d0/spec.md?plain=1#L1440-L1461
- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)