笔记:Cost Reduction Strategies on Java Cloud Hosting Services

简介:

估计这篇文章的名字会让许多上云的人感兴趣:减少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),如下图所示,作者认为粉的这部分都是浪费的。
screenshot

随着项目垂直扩展,问题越来越大。而如果扩容的话,现在的云服务器几乎都是一倍一倍的扩,造成更大的浪费。

解决方案就是使用容器技术(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.
回收策略优化的好处,从:
screenshot

变成:
screenshot

在与容器技术结合,将释放的内存供其它容器使用,增加内存利用率。

原文链接:https://www.infoq.com/articles/java-cloud-cost-reduction

相关文章
|
8天前
|
Java
Java基础—笔记—static篇
`static`关键字用于声明静态变量和方法,在类加载时初始化,只有一份共享内存。静态变量可通过类名或对象访问,但推荐使用类名。静态方法无`this`,不能访问实例成员,常用于工具类。静态代码块在类加载时执行一次,用于初始化静态成员。
10 0
|
8天前
|
Java API 索引
Java基础—笔记—String篇
本文介绍了Java中的`String`类、包的管理和API文档的使用。包用于分类管理Java程序,同包下类无需导包,不同包需导入。使用API时,可按类名搜索、查看包、介绍、构造器和方法。方法命名能暗示其功能,注意参数和返回值。`String`创建有两种方式:双引号创建(常量池,共享)和构造器`new`(每次新建对象)。此外,列举了`String`的常用方法,如`length()`、`charAt()`、`equals()`、`substring()`等。
14 0
|
1月前
|
算法 搜索推荐 Java
数据结构与算法(Java篇)笔记--希尔排序
数据结构与算法(Java篇)笔记--希尔排序
|
2月前
|
监控 负载均衡 Dubbo
|
8天前
|
Java API
Java基础—笔记—内部类、枚举、泛型篇
本文介绍了Java编程中的内部类、枚举和泛型概念。匿名内部类用于简化类的创建,常作为方法参数,其原理是生成一个隐含的子类。枚举用于表示有限的固定数量的值,常用于系统配置或switch语句中。泛型则用来在编译时增强类型安全性,接收特定数据类型,包括泛型类、泛型接口和泛型方法。
9 0
|
1月前
|
算法 搜索推荐 Java
数据结构与算法(Java篇)笔记--快速排序
数据结构与算法(Java篇)笔记--快速排序
|
1月前
|
机器学习/深度学习 算法 搜索推荐
数据结构与算法(Java篇)笔记--归并排序
数据结构与算法(Java篇)笔记--归并排序
|
1月前
|
算法 搜索推荐 Java
数据结构与算法(Java篇)笔记--插入排序
数据结构与算法(Java篇)笔记--插入排序
|
1月前
|
算法 搜索推荐 Java
数据结构与算法(Java篇)笔记--选择排序
数据结构与算法(Java篇)笔记--选择排序
|
1月前
|
算法 搜索推荐 Java
数据结构与算法(Java篇)笔记--冒泡排序
数据结构与算法(Java篇)笔记--冒泡排序