Archive

Archive for 2014

Show MySQL engine tablespace size

October 22nd, 2014 No comments

I have been trying to migrate everything in MySQL to use INNODB (death to all MyISAM), but was unsure of how much data was being stored in each storage engine. You can use the following query to give a total usage for all engines:

SELECT ENGINE, CONCAT(FORMAT(RIBPS/POWER(1024,pw),2),SUBSTR(' KMGT',pw+1,1)) `Usage` FROM
(
    SELECT ENGINE,RIBPS,FLOOR(LOG(RIBPS)/LOG(1024)) pw
    FROM
    (
        SELECT ENGINE, SUM(data_length+index_length) RIBPS
		FROM information_schema.tables AAA
		GROUP BY ENGINE
		HAVING RIBPS != 0
    ) AA
) A;

Now I have that information I can adjust my INNODB buffers and reduce MyISAM caches

Categories: Uncategorized Tags:

Speeding up percona xtrabackup restores

October 10th, 2014 No comments

I started playing around with using xtrabackup (or more specifically innobackupex) to backup MySQL. Most of our tables are now innodb so it didn’t make sense to keep dumping everything out via mysqldump.

I had a clone of our master db server in our virtual environment that I was trying to restore the backup onto, but it was taking hours (using innobackupex –copy-back /backup/). I figured that the IO on my virtual servers was just crap and I’d have to grin and bear it. There doesn’t seem to be much around about restoring using innobackupex, even the command options are limited for restores so I thought –copy-back was the only way.

It seems that if your backup is on the same filesystem as where it’s going to end up then it’s a lot faster to use the –move-back option. This changed my restore time from hours to seconds.

e.g.
innobackupex –move-back /backup/

Categories: Tech Problems Tags:

SSL by default

August 15th, 2014 No comments

All the cool kids are doing it, so I’m playing around with enabling SSL by default with HSTS. Thanks to CloudFlare and StartSSL it’s been mostly without a hiccup.

Categories: Uncategorized Tags:

Validator.nu RPM

March 10th, 2014 1 comment

I’ve been playing around with validator.nu the last few days. I have been trying to get a standalone version working so I could package it up and puppetize it. Unfortunately a lot of the standalone jar builders failed (java hell).

I finally found that it’s been released here: https://github.com/validator/validator.github.io

I whipped up a basic rpm to use this and install an init script etc: https://github.com/NoodlesNZ/validator-nu-rpm

Categories: Uncategorized Tags:

IPv6 in NZ

January 6th, 2014 Comments off

I just a quick survey of the top 500 sites in NZ (based on Alexa data) and I was disappointed to see that only two NZ based sites (excluding Google, Microsoft, Facebook etc) supported IPv6, geekzone.co.nz and nzsale.co.nz (Geekzone implemented its IPv6 via Cloudflare and NZ Sale through Akamai).

Come on people, it’s 2014. There’s no excuse not to support IPv6, especially with two RIRs on their last /8 and APNIC with ~13.5 million addresses remaining. What’s really worrying is that some of the major ISPS (Telecom, Vodafone, Orcon) don’t even have IPv6 on their public facing websites. I’d guess that their residential customers won’t be seeing IPv6 on their connections anytime soon and that CGN is a real possibility.

Categories: Uncategorized Tags: