Java进程CPU异常,如何精准定位和解决?
摘要:近期在进行日常巡检时发现,线上部分应用服务器的CPU突然比以往高出很多,经过登录机器排查确认是C2 CompilerThread线程始终长时间运行消耗了CPU。 一、现场环境 1.1. docker环境 查看docker进程: docker
近期在进行日常巡检时发现,线上部分应用服务器的CPU突然比以往高出很多,经过登录机器排查确认是C2 CompilerThread线程始终长时间运行消耗了CPU。
一、现场环境
1.1. docker环境
查看docker进程:
docker ps -a
查看docker配置:
docker inspect a5777210b249
启动docker(已启动则忽略):
docker start a5777210b249
进入容器:
docker exec -it a5777210b249 /bin/bash
1.2. 操作系统
docker容器使用的操作系统是:debian(stretch )
root@zy:/opt# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
现场jdk版本:
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
1.3. 修改 APT 源列表为归档地址
由于现场环境没有外网,这里可以通过配置代理访问外网。
1.3.1. 配置代理
配置代理:
export http_proxy=http://ip:10809
export https_proxy=http://ip:10809
export socks_proxy=socks://ip:1080
export socks5_proxy=socks5://ip:1080
1.3.2. 镜像源
# 宿主机
vim /etc/apt/sources.list
deb https://mirrors.aliyun.com/debian-archive/debian stretch main contrib non-free
#deb https://mirrors.aliyun.com/debian-archive/debian stretch-proposed-updates main non-free contrib
#deb https://mirrors.aliyun.com/debian-archive/debian stretch-backports main non-free contrib
deb https://mirrors.aliyun.com/debian-archive/debian-security stretch/updates main contrib non-free
deb-src https://mirrors.aliyun.com/debian-archive/debian stretch main contrib non-free
#deb-src https://mirrors.aliyun.com/debian-archive/debian stretch-proposed-updates main contrib non-free
#deb-src https://mirrors.aliyun.com/debian-archive/debian stretch-backports main contrib non-free
deb-src https://mirrors.aliyun.com/debian-archive/debian-security stretch/updates main contrib non-free
参考:debian镜像_debian下载地址_debian安装教程-阿里巴巴开源镜像站;
包位于:debian-archive-debian-pool安装包下载_开源镜像站-阿里云。
