The real way to improve server performance

If you want to improve server performance, the best way is to move as much of the processing off it and onto the client machine. All those visitors of yours are running souped up AMD and Intel CPUs with their big screens and fat harddrives. No wonder your small little hosting plan can’t keep up. Here are some very good ideas from a Slashdot comment I read this morning.

  • Databases can get pretty slow with complicated queries, so upload your database to the client when they load the page and then your database queries are distributed.
  • PHP isn’t very fast, and neither are Perl or Python, so you don’t want to be running them on the server either. Write an interpreter for the language of your choice in Javascript and move your business logic to the client. This will also interface better with the client side database copy.
  • SSL is a performance killer, don’t use it. If you need to send something securely just prefix it with a predetermined number of random letters and numbers, no one will think to look beyond them.
  • Writing to databases can be pretty bad too. Try discarding all your changes, your users might not notice the difference, but they will appreciate the performance gain.

Check out the original post for a few more invaluable nuggets. If you follow all these tips you’ll be well on your way to becoming a respected and l33t hacker.

And now the big news. I’m really excited about this. The next version of WordPressMU will have a special Javascript client-side db (JCSDB) library built in. JCSDB will enable distributed and parallel access to your WPMU db without the danger of harming your servers. The best thing about it? If your site is dugg or slashdotted then your visitor’s machines will handle the load transparently. Instead of using slow and ungainly TCP/IP the library will use super-quick UDP to communicate. It really is the best way of sending data over the Internet.

I expect Matt will roll out JCSDB on WordPress.com just as soon as a few of the final bugs are ironed out. It might be a bit of headache for Barry and Demitrious to administer, but at least we can get rid of at least half our servers and use them to power a massive game of Counter Strike at the next WordCamp.

Update on May 31st! You all thought this was a joke didn’t you? Well, Google Gears has just been released and “is an open source browser extension that enables web applications to provide offline functionality”.

  • Store and serve application resources locally.
  • Store data locally in a fully-searchable relational database
  • Run asynchronous Javascript to improve application responsiveness.

It’s still in beta but Google Reader already supports it by allowing you to download up to 2000 items to read offline. This could be useful when I’m flying to SF next July!

WordPress.com stats for your own blog

Andy announced a new WordPress stats plugin that uses the polished WordPress.com traffic graphs on your own self-hosted WordPress blog. I’ve been testing it here for the past few months and it’s worked fine. I must download the new plugin and install it to see what other goodies Andy has added since.

Eventually I’ll get around to releasing my own referrers plugin, but as our newborn Adam is taking up so much of our time it might be a while before I get around to it!

How I move a WordPress blog to a new host

Aaron Brazell described how he moves his WordPress blog to a new host and it’s very familiar since I’ve done something similar a few times over the last few months.

I’ve figured out a few things from those moves which you might find useful if you get sick and tired of your hosting:

  1. If you’re self hosted and have a domain name, set the “time to live” (TTL) to as small as possible, say 15 minutes. You should do this about 24 hours previously. Doing this will mean that visitors to your bog will start seeing your new host sooner!
  2. Just after you dump your database to a file for export close all your posts to comments. I do this with the SQL, UPDATE wp_posts SET comment_status='closed'. Now quickly transfer your db over and get your site up and running in the usual manner. Your old site will still get traffic for a while yet. Googlebot will still visit too, but nobody will leave comments there so you don’t have to worry about synchronising your comments table. You could do the same with ping_status too if you get a lot of pings.
  3. For extra brownie points add a small message in the comment area informing the visitor that, “Comments are disabled. This site has moved to new hosting. Please check back later to leave a comment.”
  4. If you fiddle with your hosts file make sure there isn’t an entry for your domain pointing at the old site. That happened to me on my Macbook and even after updating /etc/hosts it still didn’t work right. I had to reboot the laptop!
  5. Say “Thank You” to anyone who helps, especially support staff!

Good luck moving, it’s not as hard or as daunting as it might be. ssh, scp/rsync, mysql/mysqldump and tar/gzip are your friends when moving!

Further Reading:

PS. Thanks to Linode for hosting, Blacknight and Michele for DNS, and you for WordPress.

WP Plugin: Import your Flickr comments

I have had a plugin running on my photoblog In Photos for quite a while now that imports comments on my Flickr stream into my blog posts. It prefixed “Flickr:” to the username and linked back to the Flickr comment.

Due to overwhelming demand (two people asked!), I cleaned up the plugin a bit and put a configuration page on it and called it the Flickr Comment Importer. There are a few things to consider if you want to use this plugin but it’s straight forward to install and configure and it’s all documented on the plugin page.

Download it now!

Ireland.com uses WordPress MU

Damien alerted me to the fact that the new Ireland.com blogs are using WordPress, and so with much excitement I hit the site and browsed around. A quick look at the source showed that they are in fact using WordPress MU which is rather neat.

Ireland.com is the website of The Irish Times, a major daily newspaper here. It’ll be great to see journalists blogging there, but only if they are allowed free reign. If they pull it off, they’ll bring a lot more attention to the site.

So far, only two blogs are operating. On the Record is a music blog written by Jim Carroll, and Price Watch by Conor Pope. Conor’s first post is Window or aisle? €15 please, a short post exploring new charges by Aer Lingus. I don’t see a Trackback link there but hopefully they’ll allow trackbacks and pingbacks sooner rather than later.

Welcome to the ireland.com blog page. We have two blogs, one written by music journalist Jim Carroll, using his weekly column On The Record as its cornerstone. This blog will shed light on the machinations of the music industry at home and abroad. From today, the consumer-focused PriceWatch section will also be carried in blog form on the site. Written by Conor Pope, the blog will be updated throughout the week and will allow users to post details of rip-offs, ask questions and perhaps even highlight bargains they have spotted.

Update on Sep 8, 2009 They’re not using WordPress MU any more unfortunately. Looks like a Windows based system, with ugly urls. The links to the blogs above are broken as a result. Disappointing.

WordPress MU 1.2

Go grab the new WordPress MU 1.2 from the download page now. This is primarily a bugfix update but it also has a security fix and all WPMU site owners are encouraged to upgrade.

I’ll post to the MU forums in a few days time with details of the security fix. It’s a short one-liner that can be applied within minutes if you can’t upgrade.

Update: After you update, go to “Site Admin->Themes” and click Save. That will update the allowed themes list because it was changed a few days ago.

Edit: a few issues with themes and .htaccess rewrite problem appeared overnight. These have been fixed now. If you updated to 1.2 then download the new 1.2.1 version and copy these files into your install:

  • wp-admin/themes.php
  • htaccess.dist
  • wp-includes/version.php
  • wp-admin/admin-db.php
  • wp-admin/themes.php
  • wp-admin/wpmu-themes.php

A free daffodil for your blog today

Today is Daffodil Day here in Ireland and in honour of the day I’m offering a daffodil header image to any blogger who’d like it. There are no restrictions on how you use this image, do what you like, but I would love if you would blog about Daffodil Day.

I’ve made two header images especially suited to blogs using the K2 theme. These are 780×200 images, and to make things easier there’s a mirrored image to suit your blog title. Larger sizes are available on request.

Daffodil Day is in aid of cancer research. The Irish Cancer Society does what it can to fund raise for cancer research and care so they’re a good charity to support.

Daffodil Day is the largest annual fundraising event run by the Irish Cancer Society to raise money for people with cancer.

This year our Daffodil Day is on March 23rd, and over 5,000 volunteers nationwide will be helping to sell fresh and silk daffodils and daffodil pins.

If you would like to help out during Daffodil Day, just phone us on 1 850 60 60 60 or Email reception@irishcancer.ie

Daffodils are flowers of hope and of springtime. That is why they are such an appropriate symbol for the Irish Cancer Society’s cancer care projects. These projects help to improve the quality of care available to people with cancer throughout Ireland.

2rfx2iv.jpg

4cl4k7s.jpg

I have to admit their linking policy is a little strange. I never thought I’d have to ask permission by fax to link to a website.

Slightly later … we bought our daffodils while doing a spot of shopping in Blarney. Here’s the very nice volunteer and her springer spaniel who were manning the stall outside Supervalu. A bunch of daffodils or a pin are 3 Euro each. A small contribution to cancer research.

35nakic.jpg

Updated a year later in 2008! Daffodil Day is next Friday. I’m offering a beautiful daffodils photo for sale in aid of the Irish Cancer Society. See my blog post for further details!

Not everyone likes you

The best place to be is where people either love you or hate you. Not so great in inter-personal relationships but it’s super when you’ve got a product that you want people to use and maybe buy.

WordPress is there. There’s a vocal group of WordPress haters out there, but we’ve worked hard over a number of years to get to that level of hatred. It hasn’t been easy. On the other hand even more people like using WordPress. Thankfully someone would care if WordPress disappeared in the morning.

That’s why I’m envious of Twitter. In the course of a few months they’ve gone from being a darling of the blogging community to the nemesis of all things good and proper.

I predict that when teenagers discover Twitter the increase in txt speak will put off everyone else. Not that it will matter at that stage. Twitter will go on to become a global teen phenomenon much like myspace or bebo. Oh how we’ll gnash our teeth then. The negative feedback now won’t be anything like it will be later on! “Proper bloggers” might just ignore it but I doubt it. We They need something to bitch about and it’s an easy target!

I signed up there a few days ago but I’ve since turned off sms notifications and haven’t looked at my profile page in a while. If anyone mentions me I’ll know about it. Oh isn’t RSS cool?

You didn't hear? Upgrade now!

On the off chance that you haven’t heard the news yet. You should upgrade your WordPress install straight away. Don’t hesitate, do it now. Don’t pause to grab a cup of coffee. If you’re just waking up then rub the sleep from your eyes and jump to the download page and grab WordPress 2.1.2.

Long story short: If you downloaded WordPress 2.1.1 within the past 3-4 days, your files may include a security exploit that was added by a cracker, and you should upgrade all of your files to 2.1.2 immediately.

Users running from svn code aren’t affected, but then you probably already knew that already didn’t you? You should be subscribed to Hackers and Testers lists.

Don’t worry if you’re running a WordPress MU site. That isn’t affected, although you should upgrade to the latest 1.1.1 release as that fixes a number of problems with 1.0 as well as merging in some security fixes from WordPress core.

WordPress.com users have nothing to worry about.