I tend to use some swap in the host as a measure to prevent termination of processes.
After some success with using swap, now I want to start using swap as a page manager.
I realized I don’t really know if enabling swap on the host alone is better or enabling swap on the containers would make swap more effective.
In other words, is swap smart enough to understand the difference between the pages in a host (load being just LXD containers) vs the pages inside of a container (load being, let’s say Apache)?
Does the question even make any sense or pages are just pages and there’s no difference or similarities among pages, hence the only thing that matters is how frequently the pages are being used?
The objective of this, almost philosophical question is, as the title indicates, deciding whether to use swap on the host, on the container or on both.