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.
2 thoughts on “High performance Cacti for large installations”
These are some great high-level ways of tuning cacti for larger installations. I was very happy to see that they’ve actually added indexes. I’d noticed a high number of INSERTS and UPDATES in the MYSQL database during polling times. I’ve often tried to tweak or tune mysql.cnf file but without really knowing what my changes are often affecting or demonstratinig any real performance boost. I’m not terribly confident with MySQL, but i was always aware the indexing was a major gap in the installation. Thank goodness for 0.8.8!
My biggest installation is below:
11/07/2013 07:05:49 AM – SYSTEM STATS: Time:47.2800 Method:spine Processes:12 Threads:8 Hosts:302 HostsPerProcess:26 DataSources:83118 RRDsProcessed:32880
The most bang for the tuning buck I’ve gotten was by tuning the Maximum OID’s Per Get Request, may I suggest my latest article?
Please take a look at my article regarding
Those are some impressive results! Thanks for sharing this information 🙂