John Leach

Tag: mysql

Making a staging database with sed

Created · Tech · 1 comment

Quick one - thought was was cute and useful.  I take a copy of live databases once in a while for use in the staging environments, but some apps have references to the live url in the there (Wordpress does this and makes all its redirects using it, making it particularly difficult to test in staging).

This is a simple little way to change all the urls in the db as you clone it:

Continue reading “Making a staging database with sed” →

High performance Wordpress

Created · Tech

Of all the Wordpress installations I manage, two of them bring in a rather large number of hits.

To speed up Wordpress I usually just enable the MySQL query cache and install the eaccelerator PHP opcode cacher. On one particular box, an Intel 1.3Ghgz PIII this increased performance from around 3 requests per second to around 10.

Recently I came across the WP-Cache plugin for Wordpress. This takes the finished output from any given wordpress request and caches it to disk, serving directly from the static cache for the next hour (configurable). Any new posts or comments in the mean time immediately mark the cached version stale, so you don't need to wait around for an hour.

On the same hardware and blog, this increases performance from 10 requests per second to over 250. A 2500% increase in speed.

Continue reading “High performance Wordpress” →

Remote wireless X clients

Created · Last updated · Tech

I've setup and old Pentium 100 Toshiba laptop with a wireless card and Debian as a "dumb-ish X terminal" at home over my 802.11b wireless network. It works rather well and very quiet. My girlfriend now has all the wonders that RedHat 9 brings, without having to lug a big heavy expensive power-hungry laptop around the house. Up until now I'd had a hacky ssh remote session thing running, but now I use XDMCP (X -probe IP) to login directly using gdm listening on the central box. A firewall attempts to protect the XDMCP and X11 services, with minimal privacy provided by WEP. I'll have IPSEC implemented soon enough though.

Continue reading “Remote wireless X clients” →