louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
60.6k stars 5.42k forks source link

High CPU usage for Uptime-Kuma process #2751

Closed AndreKotze closed 1 year ago

AndreKotze commented 1 year ago

⚠️ Please verify that this bug has NOT been raised before.

🛡️ Security Policy

Description

Recently my Uptime-Kuma started getting really sluggish to the point where the dashboard and status pages would not load or only load partially. When running TOP on my server I noticed that the uptime-kuma process was constantly running at 100%.

image

👟 Reproduction steps

.

👀 Expected behavior

.

😓 Actual Behavior

.

🐻 Uptime-Kuma Version

1.19.6

💻 Operating System and Arch

Ubuntu 22.04.1 LTS

🌐 Browser

Google Chrome 109.0.5414.120

🐋 Docker Version

No response

🟩 NodeJS Version

14.21.2

📝 Relevant log output

No response

rezzorix commented 1 year ago

Before labelling this as a bug; can you give more information:

AndreKotze commented 1 year ago

I'm running roughly 100 monitors which are a mix of HTTP and PING. My server is a 4 core VM with 8GB of RAM.

On the same server I'm also running an instance of Observium which is monitoring 100+ devices through SNMP and it has no issues with performance.

AndreKotze commented 1 year ago

Here is another screenshot from htop:

image

rezzorix commented 1 year ago

System shouldnt be a problem for 100 monitors. Whats the frequency of your monitors?

AndreKotze commented 1 year ago

20 seconds.

AndreKotze commented 1 year ago

I'm not sure if this could be a contributing factor but I'm getting some weird graphs for my HTTP monitors.

image

image

image

image

rezzorix commented 1 year ago

You running it on a VM...? Then thats probably the issue?

louislam commented 1 year ago

20 seconds.

It maybe too low for 100 monitors, try to increase it to 60 or higher.

AndreKotze commented 1 year ago

I've just finished changing them all to 60 seconds but it made no difference. I'm now going to clear the heartbeats and events as well.

AndreKotze commented 1 year ago

After clearing all the historical data the CPU usage has come right down and will occasional peak above 10%.

image

AndreKotze commented 1 year ago

My system seems to be stable again so I'm going to close this issue now...

remotoservicos commented 8 months ago

My system seems to be stable again so I'm going to close this issue now...

I understand it became stable after cleaning the historical data, but that seems pretty weird. How did it behave after a few months? I'm having the same issue all of a sudden, but I didn't try cleaning anything yet.

CommanderStorm commented 8 months ago

In v1, reducing either retention/ping-rate/.. or moving to a faster storage solution is the only option to get around this problem. In v2, we have likely resolved this problem. See https://github.com/louislam/uptime-kuma/issues/4500 for further details of what needs to happen before we can release this version.