赞
踩
Github地址:https://github.com/kubernetes-incubator/metrics-server
Metrics-server是K8S中一个监控度量组件,用于替代heapster组件
Metrics Servrer 原理介绍https://blog.csdn.net/u012516914/article/details/106450116
Metrics-server通过cAdvisor及kubelet组件定期抓取Pod和Node上边资源使用情况,并且通过Metrics API暴露,然后我们可以通过Kubectl来访问这些Metrics,另外K8S支持的HPA(pod弹性伸缩)也依赖于Metrics API,除了内置的metrics-server,业界用的是主流的监控方案是Prometheus
一个JVM应用启动之后会使用到3个内存,分别为Heap Memory(堆),Non-Heap Memory(非堆),Other
首先JVM会计算出最大和最小的堆,其中最大的堆为Max allowed,这个是JVM应用直接可以向OS申请的,它首先会从初始堆开始申请,如果堆不够用,JVM会向OS申请额外内存,下图蓝框是已经分出来的
详细介绍JVM内存结构:https://blog.csdn.net/rongtaoup/article/details/89142396
==== System Info ====
Java version: IcedTea 1.8.0_212
Operating system: Linux 3.10.0-1127.el7.x86_64
CPU Cores: 1
Physical Memory: 3,931 MB #物理内存
==== JVM Memory Info ====
Max allowed memory: 792 MB #最大允许堆使用量
Allocated memory:72 MB #当前已分配(蓝框信息)
Used memory in allocated: 53 MB
Free memory in allocated: 19 MB
Total free memory: 739 MB #绿框+剩余未使用的
Heap Memory Usage: init = 16777216(16384K) used = 56109040(54793K) committed = 76472320(74680K) max = 831193088(811712K)
Non-Heap Memory Usage: init = 2555904(2496K) used = 86398056(84373K) committed = 90308608(88192K) max = -1(-1K)
[root@k8s7-21.host.com ~]# kubectl exec -it customers-5b455db5b-bbch2 sh
/ # java -XX:+PrintFlagsFinal -version | grep -E "UseContainerSupport | InitialRAMPercentage | MaxRAMPercentage | MinRAMPercentage"
double InitialRAMPercentage = 1.562500 {product}
double MaxRAMPercentage = 25.000000 {product}
double MinRAMPercentage = 50.000000 {product}
bool UseContainerSupport = true {product}
openjdk version "1.8.0_212" #新的JDK版本是支持容器的,可以辨别容器的Limit限制
OpenJDK Runtime Environment (IcedTea 3.12.0) (Alpine 8.212.04-r0)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
/ #
kubelet apply -f .
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。