CPU 和 RAM 在没有运行应用程序时随机运行吗?

huangapple go评论62阅读模式
英文:

CPU and RAM running randomly when no app is running?

问题

这是一个正常的现象吗?CPU使用率突然飙升到100%,持续几秒钟,即使我的应用程序没有在我的VPS服务器上运行,也没有活动客户端?
它确实运行了一个Apache http服务器,但我从未使用过。
我只使用Java应用程序,但在这段时间内它也没有运行。
我有一个域名和一个SSL证书,不确定是否引起了这个问题?
我担心有黑客在我的运行在CentOS 7上的VPS中放置了恶意软件。
我应该如何检查这些计算突发事件的原因?
这些事件与网络I/O相关,但单位是千字节。

英文:

Is it a normal thing to have random bursts of CPU usage going to 100% for a few seconds and RAM usage also keeps changing on its own even when my app is not running on my VPS server and no client is active either?
It does have a Apache http server running but I never use it.
My usage is for a Java application only but that also was not running during this time.
I have a domain name and an SSL certificate, not sure whether that is causing this?
I am worried that some hacker has put a malware in my VPS running on CentOS 7.
How am I supposed to check what is the reason for these bursts of computation.
These correspond with network I/O as well but that is in kiloBytes.

CPU 和 RAM 在没有运行应用程序时随机运行吗?

答案1

得分: 1

你可以使用 htop 或类似的工具,它可以在出现峰值时显示使用 CPU 资源的情况。

如果你没有安装 htop,可以使用以下命令安装:sudo yum install htop。不过需要注意的是,htop 只能实时显示当前发生的情况。

另外还有 atop。与 top 和 htop 等工具相比,atop 的主要优势在于它能够随着时间记录系统和进程信息。这对于诊断仅偶尔发生或持续时间很短的问题非常有帮助,听起来正是你需要解决的问题。

你可以使用以下命令安装 atop:sudo yum install atop
你可以启动 atop 进程并开始记录日志:

sudo systemctl start atop
sudo systemctl enable atop

要实时查看系统资源,只需运行 atop。要查看日志,可以使用 atop -r,然后输入日志文件的路径。默认情况下,atop 的日志存储在 /var/log/atop/ 目录下。

英文:

You could use htop or similar and it could show you what is using those cpu resources at the times when the spikes occur.

If you dont have htop you can install it with sudo yum install htop . However note that htop is only showing you what is happening at that time, i.e. a real time view.

However there is also atop. One of the main benefits of atop over tools like top and htop is its ability to log system and process information over time. This can be helpful for diagnosing issues that only occur intermittently or for a short period of time which sounds exactly like the thing you need for issues you are having.

You can install atop with sudo yum install atop .
You can start the atop process and logging with:

sudo systemctl start atop
sudo systemctl enable atop

To view system resources in real-time, you can just run atop. To view the logs, you can use atop -r, followed by the log file's path. By default, atop logs are stored in /var/log/atop/ .

huangapple
  • 本文由 发表于 2023年7月6日 18:41:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76627972.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定