This website is now hosted on a Raspberry Pi 3

This WordPress blog is now hosted on a Raspberry Pi 3 after a year of running on a Raspberry Pi 2. Unlike with the RPi2, I’ve not done any overclocking on this device. I’m hoping that decision will decrease the number of file system related issues and obscure kernel oopses I’ve experienced lately, but I guess time will tell.

Slackware ARM on RPi3
Slackware 14.2 on a RPi3

The RPi3 is still running Slackware ARM 14.2 and the Linux kernel is at version 4.4.7 at time of writing.

My motivation for doing the upgrade was caused by my earlier comparison of the two Raspberry Pi devices on Slackware ARM: Raspberry Pi 2 VS Raspberry Pi 3 on Slackware ARM

I hope you enjoy faster handshakes and load times on this brand new power monster :]

Raspberry Pi 2 VS Raspberry Pi 3 on Slackware ARM

Let’s get ready to rumble: a battle of two Slackware ARM powered webservers.

Hosting your WordPress installation on a RPi2 can be a challenge on multiple levels. Apart from stability issues, my biggest concern is always subpar PHP performance and additional overhead with TLS connections. To determine the potential gain of upgrading my hosting platform to a RPi3, I’ve done a few tests with a MicroSD card I recently retired due to data corruption.

I’ve focused on tasks relating to performance with PHP, MySQL and OpenSSL. When running WordPress, those services are my main bottlenecks performance wise. I’ve not used any third party benchmark tools.

All tests were done in an isolated local environment .

LAMP setup:

Slackware 14.2 (current)
Linux 4.1.18-v7+
Apache/2.4.18
PHP 5.6.19
MariaDB 10.0.24
OpenSSL 1.0.2g

The card in question is a MicroSDHC Ultra UHS-I 32GB. One advice in that regard, pick something else. For the record, I’m not doing any overclocking on either device during the tests.

PHP performance:

To keep it simple but relevant, I’m letting my caching engine calculate and display the time spent to create cached versions of dynamic pages. Printed below are the values generated per device for the url: https://blog.paranoidpenguin.net/tag/office-365/

# RPI2
/** Dynamic page generated in 2.423 seconds. */

# RPI3
/** Dynamic page generated in 1.395 seconds. */

On average (after 15 pages) PHP execution was about a second faster with the RPi3 introducing additional gain on “heavier” pages.
On average, I’m writing this down a 45% decrease in execution time for PHP scripts. A result I’m rather excited about.

MySQL performance:

I’m just relaying on the BENCHMARK() function with this test. I don’t really feel like this is much of a bottleneck with my current setup that is heavily relying on serving static pages.

# RPI2
SELECT BENCHMARK(1000000,ENCODE('praise','bob'));
+-------------------------------------------+
| BENCHMARK(1000000,ENCODE('praise','bob')) |
+-------------------------------------------+
|                                         0 |
+-------------------------------------------+
1 row in set (4.50 sec)

# RPi3
SELECT BENCHMARK(1000000,ENCODE('praise','bob'));
+-------------------------------------------+
| BENCHMARK(1000000,ENCODE('praise','bob')) |
+-------------------------------------------+
|                                         0 |
+-------------------------------------------+
1 row in set (2.98 sec)

On average I’m going with a 35% decrease in query execution times.

OpenSSL performance:

# RPi2
$ openssl speed rsa2048 rsa4096

                  sign    verify    sign/s verify/s
rsa 2048 bits 0.049801s 0.001378s     20.1    725.5
rsa 4096 bits 0.354483s 0.005280s      2.8    189.4

# RPi3
$ openssl speed rsa2048 rsa4096

                  sign    verify    sign/s verify/s
rsa 2048 bits 0.025126s 0.000673s     39.8   1485.4
rsa 4096 bits 0.172203s 0.002566s      5.8    389.7

Based on this test, the RPi3 offers a 100% increase for both rsa2048 and rsa4096. Still not awesome numbers in the grand scheme of things but definitely a clear improvement over the RPi2.

Slackware ARM on the Raspberry Pi 2 – The 1 year mark

Since I hit the one year mark today I thought I would do a quick update on my RPi2 project. A short recap to kick things off: the project had a rough start due to some overly ambitious overclocking that eventually resulted in severe data corruption. However, after implementing the necessary modifications I enjoyed close to 300 days of easy uptime before a power failure took the RPi2 down. My initial thought after the power failure was that everything was still dandy, but a few weeks later things started to go downhill fast. It all began with a few file system errors:

# Mar 17 08:06:04 kernel: EXT4-fs (mmcblk0p3):
error count since last fsck: 17
initial error at time 1458111903: htree_dirblock_to_tree:1000..
last error at time 1458111912: ext4_lookup:1588: inode 514527

Before I could power down the RPi2 to correct the errors, the server panicked and crashed. Repairing the file system only gave me a few days before another batch of file system errors emerged. This time around though, instead of throwing a kernel panic the RPi2 simply rebooted and froze during the boot up process. This kind of behavior can usually be attributed to hardware errors.

Considering that the file system errors were likely an indication of a failing MicroSD card, I decided it was time to replace it. Since I bought a few extra cards of the same brand when I got the RPi2, I simply repaired and cloned my running card to a new healthy one. That was the end of fs errors and the server was stable for the next couple of weeks.

My serenity came to a close this Wednesday when a new batch of “Oops’s” resulted in kernel panic. The initial cause this time was a segmentation fault caused by a dhcpcd-run-hook process. Dhcpcd was recently updated in Slackware current, but that could be entirely unrelated to my issue.

Slackware ARM on RPi3
Slackware ARM on the RPi3, maybe…

I’m currently undecided whether I’ll upgrade the server to run on a RPi3 or simply move this website to a cloud based VPS. I’d like to at least give it a shot with the RPi3, but considering all the issues I’m having lately I’m still on the fence. I’ll probably end up going with the Raspberry Pi though, there is just something special about having my own pocket size webserver.

The story so far: self hosting WordPress on a RPi2