Tag Archives: mysql

Fix Munin MySQL Graphs on cPanel

If you have setup munin-node on a cPanel server it’s possible that your MySQL graphs stop updating at sometime, or don’t even generate from the beginning.

To fix, edit the following file:

/etc/munin/plugin-conf.d/cpanel.conf

And make sure that the mysql section contains the following:

[mysql*]
user root
group wheel
env.mysqladmin /usr/bin/mysqladmin
env.mysqlopts --defaults-extra-file=/root/.my.cnf

Fix Unknown table engine ‘INNODB’ error on Munin

In newer MySQL versions, if you have InnoDB disabled, Munin will fail to run giving you the following error:

root@myserver [~]# munin-run mysql_connections
DBD::mysql::st execute failed: Unknown table engine 'INNODB' at /etc/munin/plugins/mysql_connections line 958.

This is caused because the error message is changing between versions and the mysql_ plugin for munin hasn’t been updated in order to recognize it.
The fix is pretty simple, just open /usr/share/munin/plugins/mysql_ with vim on line 958 (hint: vim +958 filename) and replace as bellow.

Original code

    if ($@) {
 	        if ($@ =~ /Cannot call SHOW INNODB STATUS because skip-innodb is defined/) {
 	            $data->{_innodb_disabled} = 1;
 	            return;
 	        }
 	        die $@;

Fixed code

    if ($@) {
 	        if ($@ =~ /Unknown table engine 'INNODB'|Unknown storage engine 'innodb'|Cannot call SHOW INNODB STATUS because skip-innodb is defined/i) {
 	            $data->{_innodb_disabled} = 1;
 	            return;
 	        }
 	        die $@;

Save the file and you’re good to go 🙂

Stress testing WordPress on a single node VPS

Lately I’ve been trying to find a cheap close-to-perfect-but-not-so-difficult-to-setup solution for my personal blog. A kind of “set and forget” thing if you will.
Until now, my blog was running on a Dell Dual-Xeon /w 2GB RAM cPanel server (along with a few other sites) and was working pretty smooth. Based on pingdom’s full page test my blog needed 6-7 seconds to fully load which is kind of acceptable considering the theme, the twitter/flickr integration on the sidebar and the needed dns queries to contact facebook, google analytics and woopra servers.

Last night bestvpscloud from the VPS.NET forums pointed out to this script that installs nginx, php5, mysql, exim4 and wordpress on low-end VPS servers, and after reading the comments I got to this guy’s blog who also suggested adding the dotdeb.org repository and upgrade to PHP 5.3.

Continue reading