CyberPanel Community

ClosedHourly high cpu and ram peaks

fa
fatih #1

hi everyone
every hour high cpu and ram peaks on my server.

as you can see below
top

can anyone help me why this happening?

30 replies
fa
fatih #3

hello @josephgodwinke

I searched the community before raising this topic but I couldn’t find a similar one. I checked the link you have shared in your post but it is not about the same problem. This problem happens once in every hour and the server doesn’t respond for 10 or 15 seconds.

jo
josephgodwinke #4

use htop to identify the culprit

apt install -y htop || yum install -y htop || dnf install -y htop

Reboot your server and open htop next to a browser with some of your websites open. Post a screenshot here

similar topics

fa
fatih #5

This problem only happens every hour for 10-15 seconds at exactly one o’clock (01:00), two o’clock (02:00) and so on. uninstalled redis and the load issue is still happening but web server is responding now

fa
fatih #6

installed htop and waiting for the next hour

jo
josephgodwinke #7

Do you have backups running at that hour check which cronjobs run at that hour

fa
fatih #8

hourly
what does it mean?

jo
josephgodwinke #9

No check for cronjobs that run at 00:00 or once a day at that time

fa
fatih #10

I have backups running daily for google drive but there are no cronjobs running

daily

jo
josephgodwinke #11

The backups are the reason why there is a spike in cpu and ram usage at that time. There is a root backup cronjob that executes a python file to run at end of each day or beginning of each day whichever way you want to put it

sudo crontab -e

#0 12 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Daily
fa
fatih #13

then why the hell is there a spike in cpu at the beginning of every hour if it is a daily thing

jo
josephgodwinke #14

There must be something else. I thought you meant it happens only at 01:00

jo
josephgodwinke #15

Still waiting on this

fa
fatih #16

No, the problem occurs on the first ten seconds of each and every hour

00:00 - 01:00 - 02:00 - 03:00 - 04:00 - 05:00 - 06:00 - 07:00 - 08:00 - 09:00 - 10:00 - 11:00 - 12:00 - 13:00 - 14:00 - 15:00 - 16:00 - 17:00 - 18:00 - 19:00 - 20:00 - 21:00 - 22:00 - 23:00

jo
josephgodwinke #17

We can rule out cronjobs. Do you have many php websites running

fa
fatih #19

this is the culprit

jo
josephgodwinke #20

Memory and CPU usage spiked cuase from the image it barely uses any

jo
josephgodwinke #22

That script updates bandwidth usage so that would not affect resource usage

fa
fatih #24

and its disappear on screen

jo
josephgodwinke #25

Use this to change the time the cronjob for bandwith and disk usage updates runs. You can run it once a day to the deterrent of you not seeing the most recent stats about bandwidth and disk usage until the following day

fa
fatih #27

@josephgodwinke Could you please tell me how to change the file in a more detailed way? I don’t want to make any minor mistakes.
How can I change the file exactly? Can you please explain it more?
Should I change the part where it says ‘1 hour’ into ‘1 day’?
Would that work?

jo
josephgodwinke #28
$ nano /var/spool/cron/crontabs/root || vi /var/spool/cron/crontabs/root

## change the respective like this to run at 12:00 a.m.
0 0 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/findBWUsage.py >/dev/null 2>&1

After the change monitor cpu usage

fa
fatih #30

i have another problem about remote smtp server sending mails slow. (it takes 3-5 seconds)
should i ask here or open a new thread?

Sign in to reply