Host Detail Page - High CPU usage

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Host Detail Page - High CPU usage

Post by TBT »

While accessing the Host Details page from the Views tab, we have noticed rather lengthily page load times with default number per page settings. As you increase the number of entries viewable per page, the server CPU usage increases and by setting entries to 1000 the page fails to load. Users are also unable to reset the entries to a lower number as the page needs to load in order to make this change. On the other hand, the Service Details page loads successfully in seconds with no issues with setting of 1000 entries per page.

I assume this is an optimization issue with the Host Detail Page, please advise.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Host Detail Page - High CPU usage

Post by lmiltchev »

I will have to ask our developers to look into this but it is possible that you are hitting the "default" max_input_vars limitation (1000).

http://php.net/manual/en/info.configura ... input-vars

Try adding the following line on the bottom of the "/etc/php.ini" file:

Code: Select all

max_input_vars = 100000
save, exit and restart apache:

Code: Select all

service httpd restart
Let me know if this helped.
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 »

This suggestion has not improved the situation, same result.
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 »

Are you seeing any errors in your /var/log/httpd/error_log or /var/log/httpd/access_log? If you use SSL it may be in /var/log/httpd/ssl_error_log. Please post them if you do.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Host Detail Page - High CPU usage

Post by TBT »

No errors in /var/log/httpd/ssl_error_log
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 »

You should be able to reset the view by logging into XI first and then accessing the link directly (this link will limit it to 10):

*** Make sure to change YOURXISERVER and http to https if using SSL

Code: Select all

http://YOURXISERVER/nagiosxi/includes/components/xicore/status.php?show=hosts&sortby=&sortorder=asc&host=&hostgroup=&servicegroup=&hoststatustypes=0&servicestatustypes=0&hostattr=0&serviceattr=0&page=1&records=10&pagemove=Go
Not a solution but will hopefully let you view them, let me know if that works for you.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Host Detail Page - High CPU usage

Post by TBT »

Confirmed this is a reset work-a-round.
ssax wrote:You should be able to reset the view by logging into XI first and then accessing the link directly (this link will limit it to 10):

*** Make sure to change YOURXISERVER and http to https if using SSL

Code: Select all

http://YOURXISERVER/nagiosxi/includes/components/xicore/status.php?show=hosts&sortby=&sortorder=asc&host=&hostgroup=&servicegroup=&hoststatustypes=0&servicestatustypes=0&hostattr=0&serviceattr=0&page=1&records=10&pagemove=Go
Not a solution but will hopefully let you view them, let me know if that works for you.
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 »

Edit your /etc/php.ini file and change the variables below to these values.

Code: Select all

max_execution_time = 60     ; Maximum execution time of each script, in  seconds
max_input_time = 60     ; Maximum amount of time each script may spend parsing request data
memory_limit = 256M      ; Maximum amount of memory a script may consume 
Then restart Apache

Code: Select all

service httpd restart
See if that works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Host Detail Page - High CPU usage

Post by ssax »

In addition to what tgriep is asking you to do, how many hosts do you have anyways? I created 1000 hosts and it loads in about 6 seconds, I'm wondering if it has to do at all with the total number of hosts.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Host Detail Page - High CPU usage

Post by TBT »

This particular XI Server has only 462 Hosts being monitored. Host Details now loads in roughly 45-60 seconds with the adjustments suggested by tgriep, no where near 6 seconds though.

htop is reporting httpd CPU usage at 91% while 1000 Per pages is selected, switching to 50 per page drop significantly.
ssax wrote:In addition to what tgriep is asking you to do, how many hosts do you have anyways? I created 1000 hosts and it loads in about 6 seconds, I'm wondering if it has to do at all with the total number of hosts.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
Locked