Cacti works fine out of the box for dozens of servers, but when you start to hit the hundreds with tens of thousands of datasources you will start to run into bottlenecks, namely poll cycles exceeding 5 mins and graphs with gaps in them. Sound familair? Then read on.
Strangely enough Cacti isn’t optimised for large infrastructures using the default install. You need to make a few tweaks in order to make it perform optimally with hundreds of hosts and thousands of datasources. There are three things you do. Install the Cacti Plugin Architecture, Install Boost, and tune the MySQL tables which Cacti uses. I’ll go into more detail below.
Cacti Plugin Architecture
The Cacti Plugin Architecture was designed to allow Cacti to be infinitely extended, capable of doing just about anything. Eventually Cacti will come with this baked in but for now it’s a separate install. The installation instructions are sufficient so there’s no point recapping them here.
Now that we have the Cacti Plugin Architecture setup it’s time to install Boost. Boost labels itself as a large site performance booster for Cacti, written by the people responsible for Cacti themselves. Boost removes the traditional per polling cycle rrd updates that Cacti comes with from factory and replacing them with an on demand system where all rrd data is held in ram and synced to disk at specified times. Note that Boost requires a significent amount more memory so be prepared.
The default Cacti schema lacks indexes. Creating indexes improves performance dramatically. You’ll find the SQL you need to run against the schema at the link below.
We implemented these changes and are now able to poll 300 hosts with a total of 11500+ RRD’s in under a minute.