![](/style/images/good.png)
2
![](/style/images/bad.png)
K8S request limit 资源限制后,为啥 load average 还是很高
source link: https://www.v2ex.com/t/842973
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
我看对应的进程 cpu 已经最大 200%了
request limit 都设置为 2
load average
11 条回复 • 2022-03-26 01:33:43 +08:00
hwdef 9 小时 30 分钟前
不是你这个 pod 的问题吧,你这 pod 确实也没有超设定值,load average 高的原因有很多,磁盘什么的也会影响,不只是 cpu 和内存,看你这是阿里云的虚拟机,虚拟机底层的主机如果负载高也会造成虚拟机的平均负载高,
总之就是原因很多,不一定是 cpu 的问题
总之就是原因很多,不一定是 cpu 的问题
dunhanson 9 小时 26 分钟前
@hwdef 因为这个项目很老,代码比较冗余,我现在代码在精简,有点效果,之前 top 启动的时候负载超过 200 300 ,现在<60 。但还是很高,cpu 总共也就 4 线程
dunhanson 9 小时 3 分钟前
@disk
用的基于 tomcat7 的镜像,然后启动脚本是这样子,主要是为了方便看日志
chmod 777 /usr/local/tomcat/bin/catalina.sh
sh /usr/local/tomcat/bin/startup.sh
tee /opt/health.sh <<-'EOF'
while true
do
sleep 1s
if test $( ps -aux | grep java | grep tomcat | wc -l ) -eq 0
then
ps -aux | grep catalina.out | grep -v grep | awk '{print$2}' | xargs kill -9
fi
done
EOF
sh /opt/health.sh &
tail -f /usr/local/tomcat/logs/catalina_${HOSTNAME}.out
用的基于 tomcat7 的镜像,然后启动脚本是这样子,主要是为了方便看日志
chmod 777 /usr/local/tomcat/bin/catalina.sh
sh /usr/local/tomcat/bin/startup.sh
tee /opt/health.sh <<-'EOF'
while true
do
sleep 1s
if test $( ps -aux | grep java | grep tomcat | wc -l ) -eq 0
then
ps -aux | grep catalina.out | grep -v grep | awk '{print$2}' | xargs kill -9
fi
done
EOF
sh /opt/health.sh &
tail -f /usr/local/tomcat/logs/catalina_${HOSTNAME}.out
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK