Host Detail Page - High CPU usage

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Host Detail Page - High CPU usage

Post by tgriep »

Try some of the settings in this document to increase the system performance to see if the CPU usage drops for you.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Host Detail Page - High CPU usage

Post by TBT »

Is it really an issue of PHP optimization though. Service Details page provides more information than the Host Details page, why do our Service Details with 1000 per page load in 6 seconds and the Host Details with 1000 per page load in 45-60 seconds?

Also, you have 1000 hosts loading within 6 seconds. We have 462 hosts loading in 45-60 seconds, that's quite the discrepancy, what's different....
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Host Detail Page - High CPU usage

Post by jdalrymple »

TBT wrote:No errors in /var/log/httpd/ssl_error_log
I'm surprised you're not getting any php errors. Are you sure that you're looking in the right file?

Also, how does your /var/log/mysqld.log look? Any errors there that might be slowing things up?

I have an XI server on a 1 core 1GB CentOS machine with 2500 hosts, loads 1000 hosts into the host detail page in 6.61 seconds. Not bragging, just agreeing that something is wrong with yours.
You do not have the required permissions to view the files attached to this post.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Host Detail Page - High CPU usage

Post by TBT »

jdalrymple wrote:
TBT wrote:No errors in /var/log/httpd/ssl_error_log
I'm surprised you're not getting any php errors. Are you sure that you're looking in the right file?

Also, how does your /var/log/mysqld.log look? Any errors there that might be slowing things up?

I have an XI server on a 1 core 1GB CentOS machine with 2500 hosts, loads 1000 hosts into the host detail page in 6.61 seconds. Not bragging, just agreeing that something is wrong with yours.
Since we're using SSL I've been paying attention to /var/log/httpd/ssl_error_log , however, more diligently watching logs I now see /var/log/httpd/error_log has several errors stating:

Code: Select all

[Fri Jul 24 15:02:03 2015] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /usr/local/nagiosxi/html/includes/components/xicore/ajaxhelpers-hoststatus.inc.php on line 455, referer: https://domain.com/nagiosxi/includes/components/xicore/status.php?show=hosts

[Fri Jul 24 15:02:33 2015] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /usr/local/nagiosxi/html/includes/utilsx.inc.php on line 103, referer: https://domain.com/nagiosxi/includes/components/xicore/status.php?show=hosts

[Fri Jul 24 15:02:43 2015] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /usr/local/nagiosxi/html/includes/utils.inc.php on line 1262, referer: https://domain.com/nagiosxi/includes/components/xicore/status.php?show=hosts

[Fri Jul 24 15:03:08 2015] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /usr/local/nagiosxi/html/includes/utils-xmlstatus.inc.php on line 1087, referer: https://doamin.com/nagiosxi/includes/components/xicore/status.php?show=hosts

[Fri Jul 24 15:03:57 2015] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /usr/local/nagiosxi/html/includes/utilsx.inc.php on line 105, referer: https://domain.com/nagiosxi/includes/components/xicore/status.php?show=hosts

[Fri Jul 24 15:04:18 2015] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /usr/local/nagiosxi/html/includes/utilsx.inc.php on line 96, referer: https://domain.com/nagiosxi/includes/components/xicore/status.php?show=hosts

[Fri Jul 24 15:07:57 2015] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /usr/local/nagiosxi/html/includes/utils-status.inc.php on line 69, referer: https://domain.com/nagiosxi/includes/components/xicore/status.php?show=hosts

/var/log/mysqld.log

Code: Select all

121119  9:45:40 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.66'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
121119 10:32:46 [Note] /usr/libexec/mysqld: Normal shutdown

121119 10:32:46 [Note] Event Scheduler: Purging the queue. 0 events
121119 10:32:46  InnoDB: Starting shutdown...
121119 10:32:48  InnoDB: Shutdown completed; log sequence number 0 44233
121119 10:32:48 [Note] /usr/libexec/mysqld: Shutdown complete

121119 10:32:48 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Host Detail Page - High CPU usage

Post by ssax »

For testing, try editing your /etc/php.ini and set this value to:

Code: Select all

max_execution_time = 90
Then restart httpd:

Code: Select all

service httpd restart
Then watch the error log and see if it improves.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Host Detail Page - High CPU usage

Post by TBT »

ssax wrote:For testing, try editing your /etc/php.ini and set this value to:

Code: Select all

max_execution_time = 90
Then restart httpd:

Code: Select all

service httpd restart
Then watch the error log and see if it improves.
Bumping max_execution_time = 90 no longer produces errors in /var/log/httpd/error_log and page load time is 85 seconds!
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Host Detail Page - High CPU usage

Post by ssax »

Just so we are testing with the same version, is this specific server running 2014R2.7 (noted in your signature)?
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Host Detail Page - High CPU usage

Post by TBT »

ssax wrote:Just so we are testing with the same version, is this specific server running 2014R2.7 (noted in your signature)?
Correct, 2014R2.7
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Host Detail Page - High CPU usage

Post by tgriep »

Is your mysql server off loaded to another system?
The your mysqld.log doesn't look right.
Be sure to check out our Knowledgebase for helpful articles and solutions!
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Host Detail Page - High CPU usage

Post by TBT »

tgriep wrote:Is your mysql server off loaded to another system?
The your mysqld.log doesn't look right.
Yes, that would be /var/log/mysql.log

No errors present.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
Locked