response time in Nagios Core JsonQuery

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

response time in Nagios Core JsonQuery

Postby evisus » Thu Dec 27, 2018 2:23 pm

Regards!

I'm getting information from Nagios Core through json queries. Everything worked fine but I have noticed that as the number of host and services monitored by Nagios Core increases, the response times of a json query, for example "http://172.1.1.4/nagios/cgi-bin/objectjson .cgi?query= hostlist ", they are getting slower and slower.

I'm not sure if it's Core's expected behavior, will there be anything I can do to improve performance?

Thanks
evisus
 
Posts: 52
Joined: Tue Apr 26, 2016 1:19 pm

Re: response time in Nagios Core JsonQuery

Postby npolovenko » Thu Dec 27, 2018 3:15 pm

Hello, @evisus. I'd start with increasing the memory_limit in the /etc/php.ini file. I recommend to double the amount of memory you have in the config and then restart the apache with:
service httpd restart
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 2818
Joined: Mon May 15, 2017 5:00 pm

Re: response time in Nagios Core JsonQuery

Postby evisus » Thu Dec 27, 2018 3:41 pm

Thanks for your answer.

I have tripled the size but the response times do not vary.
evisus
 
Posts: 52
Joined: Tue Apr 26, 2016 1:19 pm

Re: response time in Nagios Core JsonQuery

Postby mcapra » Thu Dec 27, 2018 4:15 pm

I'm wondering what the status of the report overhauls for Nagios Core 5 are? I vaguely recall such an item on the roadmap and it's been mentioned for Core 5 before:
https://github.com/NagiosEnterprises/nagioscore/issues/143
https://github.com/NagiosEnterprises/nagioscore/issues/280

Those CGIs could use some improvements and there's not much to be done at the configuration level currently.
Former Nagios employee
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3509
Joined: Thu May 05, 2016 3:54 pm

Re: response time in Nagios Core JsonQuery

Postby npolovenko » Thu Dec 27, 2018 4:20 pm

@evisus , Looks like memory wasn't the issue here. How many host and service checks are you monitoring with this Core server? What is the actual response time for JSON queries? Nagios is using the objects.cache file to pull the objects definitions so disk IO would play a big role in how fast Nagios will gather the information. Implementing a ramdisk would be my next recommendation. This should increase the speed it takes for nagios to read/write from the objects.cache file since it will be moved to the ram disk.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 2818
Joined: Mon May 15, 2017 5:00 pm

Re: response time in Nagios Core JsonQuery

Postby evisus » Thu Dec 27, 2018 4:29 pm

I think I'll have to wait for Nagios Core 5.
evisus
 
Posts: 52
Joined: Tue Apr 26, 2016 1:19 pm

Re: response time in Nagios Core JsonQuery

Postby npolovenko » Thu Dec 27, 2018 5:11 pm

Didn't see mcapra's response. @evisus, That works.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 2818
Joined: Mon May 15, 2017 5:00 pm

Re: response time in Nagios Core JsonQuery

Postby evisus » Fri Jan 04, 2019 7:35 am

Hello @npolovenko.

I have reviewed the recommendation indicated by @ mcapra's and I have made the changes in the file "status.c" to then recompile Nagios Core.

However, the response times are the same.

I'm not sure if I understood correctly what is explained in the forum.

Thanks for your support
evisus
 
Posts: 52
Joined: Tue Apr 26, 2016 1:19 pm

Re: response time in Nagios Core JsonQuery

Postby mcapra » Fri Jan 04, 2019 12:31 pm

My intention in posting those GitHub issues was to indicate that there are known inefficiencies within those CGIs. @jfrickson indicated (in #271) that eliminating portions of the report can provide some performance gains.

Throwing hardware at the problem (as suggested by @npolovenko via a ramdisk) is one potential option.

The ultimate solution is better cross-referencing of objects within the Nagios Core runtime, rather than iterating over large lists to aggregate the information provided by the reporting CGIs. That's a bigger lift that simple changes to the status CGIs, though. Which I imagine is why this particular problem was put in the Nagios Core 5 milestone rather than tackled in a minor release.

I am almost positive a custom, faster reporting CGI could be written to be more performant for your specific use case (though I do not yet know what that use case is). That's generally not something this community can assist with, though Nagios Enterprises has offered custom development services in the past (for a price).

You could also look at implementing something like MK Livestatus instead of relying on the JSON CGIs for whatever your use case happens to be. I'm not totally confident it will be faster than the JSON CGIs (really depends on your use case), though it is at least worth exploring.
Former Nagios employee
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3509
Joined: Thu May 05, 2016 3:54 pm

Re: response time in Nagios Core JsonQuery

Postby evisus » Fri Jan 04, 2019 12:46 pm

Thank you very much for the help and recommendations.

I'll see what results I have with RamDisk and I hope Nagios Core 5 will be released soon.

Greetings and an excellent 2019!
evisus
 
Posts: 52
Joined: Tue Apr 26, 2016 1:19 pm

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 9 guests