Backend cache folder grows and grows

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sgargano
Posts: 51
Joined: Mon May 23, 2016 9:06 am

Backend cache folder grows and grows

Post by sgargano »

Hello,

we have enabled the backend cache feature to decrease the server load due to large amount of running checks.

Following the guide we also mounted the partition to the tmpfs --> https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Unfortunately we have seen that this folder grows without freeing up itself, it only grows and has to be monitored manually to delete those files (xml) manually. We know a reboot will empty this folder since it is mounted to tmpfs but for obvious reason we won't reboot this server so often.

Question: is it something not working or should we implement by our self a crontab to delete the oldest files?

Thanks for your suggestion..
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Backend cache folder grows and grows

Post by cdienger »

Did you make the cache 512MB as suggested on the screen? How many hosts and services are there on the system total? The cache is going to hold data from all the hosts and services and populated as it makes calls so you may need to increase it if you have a very large system.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
sgargano
Posts: 51
Joined: Mon May 23, 2016 9:06 am

Re: Backend cache folder grows and grows

Post by sgargano »

Thanks for your reply,

yes I have now expanded the size to 1024, we currently have 1300 hosts and 4500 services checks running.

In any case, it looks like the xml's generated have never been automatically deleted. As you can see by the img attached, the trend is only growing until I have deleted manually on 23rd of Jan. and after that day is going up again...
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Backend cache folder grows and grows

Post by cdienger »

I confirmed with dev that it will not delete cached files. Periodically deleting the files may be necessary, but as it caches every unique call, it should eventually level off.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
sgargano
Posts: 51
Joined: Mon May 23, 2016 9:06 am

Re: Backend cache folder grows and grows

Post by sgargano »

Understood,

will you provide an official script or an update release to automatize the deletion process?

Thanks
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Backend cache folder grows and grows

Post by lmiltchev »

Unfortunately, we don't have such a script. However, you could set up a cron job to delete files, older than x days, e.g. a week.

This is just an example. Modify it to match your environment.

Code: Select all

0 0 * * 0 /usr/bin/find /usr/local/nagiosxi/tmp/backendcache -type f -mtime +7 -name '*.xml' -execdir rm -- '{}' \;
Let us know if you have any further questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
sgargano
Posts: 51
Joined: Mon May 23, 2016 9:06 am

Re: Backend cache folder grows and grows

Post by sgargano »

Thanks,

the example above does not go trough the subfolders where the xml resides.

I added this code which will delete the folders instead:

Code: Select all

/usr/bin/find /usr/local/nagiosxi/tmp/backendcache/* -mtime +30 -type d -exec rm -rf {} \;
Thanks for your support.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backend cache folder grows and grows

Post by scottwilkerson »

sgargano wrote:Thanks,

the example above does not go trough the subfolders where the xml resides.

I added this code which will delete the folders instead:

Code: Select all

/usr/bin/find /usr/local/nagiosxi/tmp/backendcache/* -mtime +30 -type d -exec rm -rf {} \;
Thanks for your support.
Looks good. Thanks for sharing
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked