Faster webserver on Raspberry Pi

The Raspberry Pi has a 32-bit ARM CPU running at 700MHz by default, although you can usually overclock them somewhat and still enjoy stable behavior. I’m running Raspbian, a Debian-based distribution built for the Pi.

One thing that’s mildly annoying is that running WordPress on the Pi using Nginx and php-fpm has been dog slow, more so than just due to the relatively low clock speed of the CPU. I finally figured out why. I noticed some entries showing up in the Nginx virtual host error log: an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/3/07/0000000073 while reading upstream. The responses from PHP were being buffered to disk (in this case, an SD card which is the boot device). I googled and found the option I needed to set. Once that was set to 0 and Nginx was restarted, I immediately noticed an improvement in the response time.

Before finding this, I’d tried setting various things in W3 Total Cache plugin for WordPress that didn’t make much of difference. Now some of these caching options produce a noticeable boost in performance in addition to the bump from avoiding disk buffering. Needless to say, I’m much happier with the performance.

Faster webserver on Raspberry Pi is original content from devolve.