估计这篇文章的名字会让许多上云的人感兴趣:减少Java云主机服务费用的策略,主要介绍的就是通过使用容器技术降低Java云服务器的费用。
Key Takeaways
As your project grows you need to move to larger VMs. But if the next step up exceeds your requirements, you are overpaying
Containers offer higher granularity than VM's, and can be scaled vertically without rebooting the running instances
Monolithic and legacy applications can be migrated from VMs to system containers without modifying your settings
Scaling Java vertically requires proper JVM configurations, and the shrinking garbage collector
"Pay as you go" vs "Pay as you use" cloud pricing models and the right choice to increase efficiency
开篇就是:你为VM(Virtual Machine)多付钱了(Admit That You Overpay for VMs),如下图所示,作者认为粉的这部分都是浪费的。
随着项目垂直扩展,问题越来越大。而如果扩容的话,现在的云服务器几乎都是一倍一倍的扩,造成更大的浪费。
解决方案就是使用容器技术(Migrate from VMs to Containers)以及优化垃圾回收策略(Enable Garbage Collector with Memory Shrink)
容器化的好处:Now each container can be scaled up and down on the fly with no downtime. It is much thinner compared to virtual machines, so this operation takes much less time compared to scaling with VMs. And the horizontal scaling process became very granular and smooth, as a container can be easily provisioned from the scratch or cloned.
回收策略优化的好处,从:
变成:
在与容器技术结合,将释放的内存供其它容器使用,增加内存利用率。
原文链接:https://www.infoq.com/articles/java-cloud-cost-reduction