After successfully installing Cacti on my RPi and letting it poll for a few cycles with the default local host device setup, it was apparent that it was a little sluggish. Nothing terribly bad, but obvious when compared to my other deployments, which is understandable considering RPi’s specs.
At first I considered perhaps I had made a mistake not going with lighttpd over apache2, however I quickly found another optimization option….
This tutorial includes some interesting info on reclaiming some RAM reserved for graphics processing…which RPi as a server really doesn’t require.
“The Raspberry Pi has 256Mb of RAM. This RAM is however shared between the graphics and main system memory. By default 64Mb is allocated to graphics. This is overkill if you don’t plan to run the graphical interface (or rarely) as in the case of a server. To reduce the amount of memory available for graphics to 32MB enter the following command.
sudo cp /boot/arm224_start.elf /boot/start.elf
(you can restore the previous configuration
sudo cp /boot/arm192_start.elf /boot/start.elf )”
Next, I installed php-apc which I found out about in this discussion on WordPress optimization on RPi in the rasperrypi.org forums:
Found a nice write up on php-apc here :
“APC is an opcode cache that can significantly speed up your PHP applications, by caching both PHP code and user variables. Adding APC to an application usually results in improved application response times, reduced server load and happier users.”
Install was super easy:
sudo apt-get update
sudo apt-get install php-apc
And the following lets you serve a web gui for easy management and reporting:
sudo find / -name apc.php
sudo cp /usr/share/doc/php-apc/apc.php /var/www/apc.php
sudo service apache2 restart
So far these steps seemed to have helped, especially between polls. During polls site navigation slows down a touch. Not entirely sure that this set up could handle monitoring a medium to large network of devices, but certainly seems to be able to handle reporting on itself and maybe another device or two. I’ll poll a few more of the devices in my lab to see how performance is affected and let you know.
I may try lightpd on the next Rpi just to compare.