Preventing runaway MySQL queries

If you use a MySQL database with large tables, it’s possible to accidentally run queries that try to sort millions of rows (usually through some kind of programming error, such as an “unconstrained table join”).

Those runaway queries can slow down the MySQL server for many minutes on end, causing performance problems.

To prevent the worst of that, we’ve set the max_join_size setting to 1,000,000 on our MySQL servers.

Read the rest of this entry »

Use WP Super Cache for WordPress speed, not W3 Total Cache

We keep coming across WordPress customer sites that have hurt their performance by switching from the “WP Super Cache” plugin we recommend to a newer plugin named “W3 Total Cache”. Unfortunately, their site often ends up being far slower after switching to W3 Total Cache.

If you care about the performance of your site, please stick with WP Super Cache unless you have a very good reason to switch. It works, and it works well.

Some people tell us that W3 Total Cache works just as well if it’s properly configured, and they may well be right — but it seems like it’s difficult to configure properly. Our experience is showing that it’s easy to get wrong, and performance ends up suffering. WP Super Cache makes it easy to get great performance.

PHP 5.2.6 and Joomla

After upgrading our systems to PHP 5.2.6, we received reports of an incompatibility with Joomla. Some URLs do not work when Joomla is configured to use “Search Engine Friendly URLs”, but to not have “Use Apache mod_rewrite” turned on.

We’ve investigated this, and it’s caused by Joomla assuming that PHP has a bug that makes it work incorrectly, when in fact it’s supposed to work differently (and is clearly documented to work differently). Older versions of PHP had this bug, but the new version doesn’t.

To help our customers work around this, we’ve “patched” PHP to intentionally reintroduce the old bug for now, thus keeping it “compatible” with Joomla. If you were having trouble with Joomla’s “Search Engine Friendly URLs”, it should be fixed.

We’ll provide more technical details (and a more robust long-term solution) in the near future.

Update: We’ve also reported this problem to the Joomla developers and suggested a solution.

Scheduled maintenance for Linux updates (completed)

Due to software updates on our servers, Web hosting customers will experience about seven minutes of scheduled maintenance downtime between 11 PM and 1 AM Pacific time starting on one of the following nights, depending on which server your site is on:

  • Thursday, February 4 (servers beginning with the letter “L”, such as “lrrr”)
  • Friday, February 5 (all other servers beginning with letters “F-Z”, such as “farnsworth”)
  • Saturday, February 6 (servers beginning with letters “A-E”, such as “amy”)

Read the rest of this entry »

Super-fast database writes with INSERT DELAYED

Many Web sites write data to a database. Usually, the data absolutely must be properly saved, so the default way of adding records (using an SQL “INSERT” statement) ensures that the data is permanently stored on the server’s disks. Doing that takes a relatively long time in computer terms — it’s much slower than most things computers do.

In some cases, you might be storing data that’s not quite so important. And if it means your application can run much faster, you might be willing to risk a very small chance of data loss. That’s where MySQL’s “INSERT DELAYED” statement, which works with MyISAM table types (but not InnoDB tables), can be useful. (Tables are created as type MyISAM by default, so most tables are eligible to benefit from this tip.)

Read the rest of this entry »

Servers now have direct Gigabit Internet links

We’ve finished upgrading our network so that all of our customer Web hosting and mail servers have full, direct gigabit links to Internet peering points, with no 100 megabit Ethernet segments anywhere. This involved replacing old Ethernet switches and retiring old servers, and now we’re more than ready for the future.

Read the rest of this entry »

Better performance from WP Super Cache

If you use the WP Super Cache WordPress plugin (and you should, if you use WordPress), it has a settings page section titled “Expiry Time & Garbage Collection”. It sets the “Cache Timeout” to 3600 seconds by default, and warns that you should set it lower on a busy site.

That advice makes sense if you have a sudden surge of traffic to a single page. However, if your site is generally very busy across all pages (for example, if you have an archive of hundreds or thousands of posts that are constantly being indexed by search engines), we’ve found that you should do the opposite to improve performance: set it much higher. We recommend setting it to 172800 seconds (which is 48 hours). This can cut your CPU usage in half, which will speed up your site.

Read the rest of this entry »

Followup to January 15, 2010 problem

On Friday, a problem made our “My Account” control panel system unavailable for about three hours, and caused some other problems as well. We promised we’d follow up with more details.

Read the rest of this entry »

WordPress 2.8.6 security update

If you use WordPress blog software on your site, be sure to upgrade to WordPress 2.8.6. The upgrade contains important security fixes. Upgrading is usually easy with the built-in WordPress “update now” feature.

Although all WordPress users should upgrade, we’ve added security rules to our servers to protect our Web hosting customers who haven’t yet upgraded. Other people may find the rules useful if they use mod_security on Apache Web servers. The rest of this post contains more technical details.

Read the rest of this entry »

Ruby on Rails 2.2.3

We’ve updated the default version of Ruby on Rails on our servers to version 2.2.3.

Read the rest of this entry »