Jul 28 2010

High performance Cacti for large installations

Brandon Yap

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.

http://cactiusers.org/wiki/PluginArchitectureInstall

Boost

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.

http://docs.cacti.net/plugin:boost

Database Tuning

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.

http://bugs.cacti.net/view.php?id=1333

Result

We implemented these changes and are now able to poll 300 hosts with a total of 11500+ RRD’s in under a minute.


Jul 9 2010

iPhone and iOS 4′s persistent wifi

Brandon Yap

There’s not a lot of information surrounding the new persistent wifi feature in iOS 4 and how it affects iPhones. I did some experimentation and managed to find something which i’d like to share with those who are seeking the same information.

First of all on iPod Touches, persistent wifi works as advertised and stays on wether or not the phone is plugged into the charger. This is so it can maintain a constant data connection for Push Notifications and mail checking.

With iPhones the situation is a little different and conditional. Under normal circumstances where 3G is available and cellular data turned on, persistent wifi will NOT be enabled. Only when 3G becomes unavailable or cellular data is turned off will persistent wifi be activated. The reasoning for this is with the 3G radio already enabled and an internet connection present, why waste battery by enabling wifi as well. If you want to enable wifi while 3G and cellular data is also enabled, you’ll need to plug the iPhone into a charger.

So to summarise, persistent wifi (as defined by wifi that stays on even after sleeping for 15 mins) will only be enabled under the following conditions:

  • 3G is unavailable
  • Cellular data is turned off
  • iPhone is plugged into charger

Note: The disabling of cellular data discrete from 3G was introduced in iOS 4 and not present in previous iPhone OS revisions.