The use of Swap is not allowed on a VPS server, as all cloud server services use Zones fast SSD disks whose lifetime is directly related to the use of SWAP.
The use of SWAP dates back to the days when servers ran on spinning disks (HDDs), where writing to disks did not cause HDDs to shorten their lifespan and performance to directly degrade.
Every SSD has a “lifetime”, how much data can be written to it. This is measured by DWPD (Drive writes per day). Cheaper disks have a DWDPD of 0.3, more expensive disks up to 10. For example, a 400GB disk can write 120GB to 4TB per day, depending on how expensive and high quality the disk is.
If you start using SSDs for storage instead of RAM, the SSD will be “burnt out” very quickly.
You can see how much lifetime an SSD has left with the smartctl utility. Different disk vendors have different names for this, for example Media_Wearout_Indicator, Wear_Leveling_Count, Percent_Lifetime_Remain etc. It starts at 100 and ticks silently to zero.
When the lifetime drops to zero, this is expressed as writes becoming very, very slow and the service becomes basically impossible for all VPS server clients to use. This is the reason why VPS services based on SSD disks cannot use SWAP in a shared environment.