Daily Process log vs. /usr/local/cpanel/bin/dcpumonview

MrIver

Active Member
Feb 24, 2020
35
7
8
Denmark
cPanel Access Level
Root Administrator
Hej Guys,

We are running a server with 200+ clients on it.

In our daily process log, we have a client who uses 1.84% CPU.
However, when we run /usr/local/cpanel/bin/dcpumonview in terminal the same client accounts for 29,23%

Why is there a difference and which log/overview should we trust?

Thanks!
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
The daily process log shows two separate views, the top being the average since 0000 that day and the bottom section being the Top Processes - or the highest CPU% used for any period of time, this could be a spike that lasted 10 seconds or one that lasted several minutes and then never occurred again.

This interface is dcpumon as a user interface. The statistics here are output from the cron for dcpumon that runs every 5 minutes

Code:
*/5 * * * * /usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1
This is all detailed in the documentation here: Daily Process Log | cPanel & WHM Documentation

Specifically:

Note:
The ps uxaww command collects the above information about the user, CPU, and MEM.
  • This command runs every five minutes as part of the /usr/local/cpanel/bin/dcpumon cron job, as the root user.
  • The system stores the process’s data in the /var/log/dcpumon log file in ASCII format.
If you see differences in the information being shown I'd assume that dcpumon isn't completing the cron as intended is the cron present on your server?
 

MrIver

Active Member
Feb 24, 2020
35
7
8
Denmark
cPanel Access Level
Root Administrator
Thank you very much for your fast replay. Our Daily process log and /usr/local/cpanel/bin/dcpumonview does definitly not match.

Forgive me, but how do i check if the cronjob is running? I have tried various commandline codes in terminal, but nothing seem to show anything?

Thanks!
 

MrIver

Active Member
Feb 24, 2020
35
7
8
Denmark
cPanel Access Level
Root Administrator
Thanks again.

I can see that we have

Code:
*/5 * * * * /usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1
set as a cronjob

So that might not be the issue....

I have this on the user in dcpumon:

Code:
|XXX|XXX                |23.40|0.04|0.0   |
| Top Process | 71.0 | lsphp:/home/XXX/public_html/index.php |
| Top Process | 70.0 | lsphp:/home/XXX/public_html/index.php |
| Top Process | 67.0 | lsphp:/home/XXX/public_html/index.php |
while in daily process log the same user has:

Code:
User    Domain    % CPU    % MEM    MySQL Processes
XXX        XXX        1.47        0.03    0.0
Maybe I am reading it wrong?
 

MrIver

Active Member
Feb 24, 2020
35
7
8
Denmark
cPanel Access Level
Root Administrator
Ok...I think I fould the anwser myself!

It states in Daily process log that "You have 16 CPUs; therefore, these CPU percentages are divided by 16 to indicate the true percentage of all CPU power used."

So 23.4/16 = 1.465

Which matches the stats in Daily Process Logs.

Thank you very much for your help!

On a side note...Do you think we should notify the client, is 1.47% / 23.40% CPU alot? Its 50-100 times more than other users on the server :-S
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Ahh, It's the division with the CPUs that makes display differently. That makes sense, I thought about adding a note about that yesterday and regret not doing so now.

As far as whether or not you should notify them, I can't tell you what to do but I can tell you my past experience. I used to work for a hosting provider which had a lot of shared hosting, one thing we would suspend users for is if their average daily usage was over 2% as shown in the first graph in the daily process log. Keep in mind that I believe these were 8 cores, not 16 at this time but either way, the math is done, 1.47% on shared seems like a good red flag or warning point.

A lot of times it happened that you'd be able to also see the specific processes causing this in the second (Top Processes) graph. But if not we'd go through/investigate and find what was causing the usage, then let them know based on our findings how to approach the issue or that we changed a password or something of that nature. It might be best to approach it like that?
 

MrIver

Active Member
Feb 24, 2020
35
7
8
Denmark
cPanel Access Level
Root Administrator
Hi cPanelLauren,

Thank you so much for your reply. We have already reached out to the given client and asked them to turn of or reduce the processes causing the CPU overuse. I think your "limit" of 2% is a good rule of thumb for when to contact the customer - we would probably use that in the future.

Thanks again for your great service.
 
  • Like
Reactions: cPanelLauren