I mentioned in an earlier post that I’m planning to host this website on a colocated Raspberry Pi. Meanwhile, my RPi has arrived at EDIS’ data center in Graz, Austria. I transferred all relevant files and database tables from this WordPress installation to the new home on the RPi. I had to tweak my LAMP installation to reduce the memory footprint because the default settings for Apache and MySQL tend to eat quite a bit of RAM. When I started testing the WordPress installation, something interesting happened: it took more than 10 seconds to serve a page.
I was able to speed up page loading using the WP-Super-Cache plugin, but any page which wasn’t served from the cache obviously still took a lot of time to load. Even though there was always enough memory available and the CPU load wasn’t that high, it took MySQL quite some time to respond to rather simple queries. Now, if it’s not the RAM, not the CPU, and not the network, the only thing left is storage. I’m using a SanDisk Extreme Pro UHS-1 card on the RPi. On my notebook, this card easily reads/writes sequential data at up to 70 MB/s. Based on my tests it looks like the RPi maxes out at 20 MB/s so using a fast UHS-1 card seems to be a waste of money, in hindsight. However, even just 20 MB/s won’t explain WordPress page loading times of 10 seconds.
I’m not 100% sure here but since SD cards are optimized for sequential data IO (that’s what’s important in cameras) they may be disadvantageous in situations where fast random access IO is needed – like accessing indexes and reading data records from a bunch of database tables. For the time being, this site is going to stay at its old place.