4 ms·
It would be possible. Paying for CPU and memory was the business model of hundreds of data processing companies that ran mainframe batch jobs and time-sharing s
by rbanffy 6y ago
It would be possible. Paying for CPU and memory was the business model of hundreds of data processing companies that ran mainframe batch jobs and time-sharing services on partitioned machines. Mainframe companies billed users by machine usage (with the machine on-site). This is obviously doable.
It raises some isolation concerns, however. To make this work, the host needs to know how much memory is allocated to a given tenant, and that's difficult without having access to the OS running inside the machine, which is easy with containers, but not so much with VMs. The tenant can turn off virtual CPU cores in the VM and the hypervisor can pick that signal up (at least in Linux) but I'm not sure it's possible right now to do the same to virtual memory modules. I'd love if AWS allowed me to do that because the boot process of some of my workloads is more CPU-bound than the rest of the machine's lifetime and having a bunch of extra cores at boot would do wonders. If, under memory pressure, I could "plug in" more virtual memory modules, it'd also be quite nice.
There could be a market opportunity, but whoever does it would need to beat the current incumbents in price or this would not fly. Also there would be some difficulty scaling up - all these extra CPUs and memory would need to come from somewhere and would necessarily fail (or need to trigger a live VM migration, which, IIRC, nobody does in cloud environments right now) if the host box's resources are fully allocated.
- sebazzz 6y agoI have a related question: how can you know that a VM is being limited in terms of CPU power? As an experiment I deployed several apps to Azure S1 tier and they appear to be good bit slower than running on a VM on our Dell R740 on-premises server.
- lykr0n 6y agoThe cloud is always going to be slower the physical hardware of similar specs. This is fact. You don't use the cloud for performance. You can't unless the provider is exposing those kind of metrics to the system. Some systems, such as VMware can expose CPU allocation time, CPU Wait, and other metrics that show much time you're waiting for resources Azure S1s are shared CPU. My guess is that Azure is running 4 VMs per core or something, so you can get more then 25% of CPU if there isn't any contention, but you might only be 25% of that core
- WrtCdEvrydy 6y agoBe aware, most cloud companies consider a 'core' to be a hyperthread. When ARM released on AWS, it was a double punch because it has no hyperthreading on the chips so you get a full core at a cheaper price.
- blibble 6y agofor memory the tech already exists: https://en.wikipedia.org/wiki/Memory_ballooning https://en.wikipedia.org/wiki/Memory_ballooning you could bill based on how much has/hasn't been ballooned out CPU: AWS already have burstable instance types, which bill you more for usage if exceed your quota: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-credits-baseline-concepts.html https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstabl...
- rbanffy 6y agoBurstable cores works as long as you are sharing the core with other processes. The moment you have the whole core for you you either migrate the process to a faster core (imagine a Xeon Lakefield with 16 beefy cores and 128 Atom-like ones), possibly on a different host, or add more cores to the VM you have.
- toast0 6y agoWith appropriate cooperation between host and guest, you could use memory balooning [1] for this. Basically the guest is told the system memory is huge, but allocates most of it to a baloon driver that just gives it back to the host. You could signal the host to give it back to the guest when needed / paid for. Complications: a lot of oses and some programs will tune themselves on startup to the size of the ram, if the baloon is large, you would have a lot of ram used in bigger kernel structures that might be never used. There's probably a practical limit on how much your memory could grow. Provisioning would be complex, as you mentioned. Google cloud is documented to do live migration away from hosts that need maintenance, so it seems possible to at least potentially move guests if they want more ram and can't get it on the current system. You could also make expandable guests colocate with preemptable guests, and preempt guests when expansion was needed. Presumably, you could also make a tier with premptable ram, but that seems pretty specialized, I'm not sure if you would get enough users to meet provisioning needs. Some physical systems have hotplug ram, but it's not very common. The expense doesn't seem worth the gains in most cases. [1] https://en.m.wikipedia.org/wiki/Memory_ballooning https://en.m.wikipedia.org/wiki/Memory_ballooning
- rhn_mk1 6y agoGiven that hotplug exists, couldn't it be used to communicate the amount of available RAM to the guest instead of ballooning? That would leave the OS responsible for swapping hungry programs out and resizing kernel structures. I guess the missing piece is that it doesn't leave a good way for the guest to request more RAM (maxing out the balloon?).
- sscarduzio 6y agowhat if the guest's way to ask more ram is a super simple API call coming from a simple autoscaling system based on basic CPU/RAM usage metrics?
- jacques_chester 6y agoI expect the mainframe model will re-emerge at some point. Paying for consumption instead of capacity is just too attractive. One thing that would make this easier would be a shift towards systems like LegoOS[0]. Instead of a host-centric design, you directly attach hardware components to a "fast enough" network, each with a little bit of local controlling logic. So there are no hosts per se, just a pool of CPUs, a pool of RAM, a pool of disks etc. It wouldn't be suitable for workloads where locality dominates flexibility. But in the long run, it could be very useful for scale economies. Especially since different workloads have different patterns of demand for CPU, RAM and disk. [0] https://www.usenix.org/system/files/osdi18-shan.pdf https://www.usenix.org/system/files/osdi18-shan.pdf