When creating a new LXC, should we allocate swap? How does Proxmox treat that? If I give a machine "GB RAM + 2GB SWAP does the machine actually have access to 4GB RAM or is its swap somehow passed through to a real swap file on the Proxmox root fs?
I think how swap is handled by LXC is stupid. You swap on slow harddrive even when you have plenty of fast RAM space available on the guest. This eats up precious IO (and basically kills database performance for all containers). OpenVZ does it the opposite way. They have vSwap, which is rate limited swap in RAM, which can be used by guests. Once the RAM gets full, this vSwap gets swaped on harddisk. So it does not screw up the host IO unless necessary.
Best to use zRAM which does exactly the same as your described way of vSwap.
But it does not rate limit the swap, so if container swaps lot, it can eat all your CPUs.