Quote:
Originally Posted by
leo_ultra_leo
My box living with another VMs in the same host, so I don't want my box swap the others!
Then don't use any RAM on your VM. Kinda hard to do, but preventing other VMs from swapping is related to how much RAM you actively use.
RAM use is what forces other things in memory to be swapped out. The swap device is merely the persistent storage where the OS copies contents of physical memory that is needed by something else.
How much swapping is happening on the physical server is something the admins of that server have to deal with. Depending on how many VMs are hosted on the physical server, the swapping caused by your one machine might be about as significant as tossing rocks into the ocean during a storm. Yeah, your rocks still make waves but you can't even seem them.
Any system running as a VM that uses enough resources to starve out other VMs on the same physical host should IMO not be running as a VM - it needs it's own physical host. Even if you're virtualizing such a system for reliability - so you can migrate it in case of a hardware failure - you still need to keep enough physical server resources in reserve to account for that. In that case, run a physical active-active cluster and get better performance when running normally and probably much faster if not totally transparent failover in a failure scenario.
And if you're just outsourcing the physical hardware admin by using "the cloud" and getting pushback from your cloud provider for using too much resources, that's a contract issue between you and your cloud provider.
"The cloud" is pretty much just mainframe-computer era timesharing. It's "run and save my stuff on another person's computer". Sure, there's a LOT more functionality and we can do a lot more now as technology and performance have improved by leaps and bounds. There are some tremendous advantages to that as you can get access to enterprise-level availability, reliability, and even security without shouldering the entire cost of such infrastructure, but it's still just "run and save my stuff on another person's computer".