14

Has anyone done any real performance comparison testing on RPi 3 on popular web servers:

  1. Apache2 -- the most prevalent server
  2. Nginx -- the server that claims to be best performer
  3. Lighttpd -- the most lightweight server
  4. Or a package I have not heard of

Something like this 4 year old post for the RPi 2. Following the advice in that post, I broadened my research more generally and found this article, but consider it slightly suspect as it's a hosting company, and I need an answer tailored to the hardware of the RPi 3.

Sandor Dosa
  • 521
  • 1
  • 5
  • 17

3 Answers3

8

This should be a comment, but its a bit long.

While I've not (yet) tested out various webservers on my Pi, I have previously run a lot of testing on webservers running on x86 server hardware. What I know from there is:

  1. most people get confused about the difference between performance and capacity - you'll see lots of posts claiming nginx is faster than (pre-fork) apache, this is not true, except under heavy load. Nginx (and lighty) are both much better at capacity. And that's at the most trivial level of analysis.

  2. Few people serve up exclusively static content with their webservers (in this scenario, tux and G-Wan leave the servers you've mentioned in their dust). The performance profile is highly dependent on the logic tier technology and its integration with the webserver.

  3. The performance (and capacity) is dependent on everything else running on the device.

There are lots of features of a datacentre server which are very easy to live without if you have proper cluster level redundancy (dual psu, dual network, remote console...) however a Raspberry PI doesn't make the best sense as a web serving platform due to slow disk I/O - you really need something with SATA, [i]SCSI, AOE or infiniband connectivity to your storage. The Pi doesn't have a SATA interface, only has one ethernet port and I'm not aware of an infiniband or SCSI interface.

(there are small, single board computers which are a more sensible choice for building webserving capability on - and a cluster of these can make good economic sense, but in such a scenario you are looking at multiple nodes with layered capability for SSL termination, HTTP caching, webserving, application logic and data management).

The question of fastest is hard to define, different for each case and impossible to answer.

However the biggest mistake I see again and again in IT, is people picking products based on a single attribute rather than considering the wider impact both in terms of the technology and people involved.

Bex
  • 2,929
  • 3
  • 26
  • 34
symcbean
  • 181
  • 1
  • 4
3

I have chosen the lighttpd option, for the following reasons:

  1. lightweight
  2. one of the easiest to install
  3. runs on my RPi2 for the last two years without any problems (24x7)
  4. needed a good and simple to use as my test device

I use it as:

  1. monitor my system cpu temperature, ambient/room temperature and Humidity graph logger
  2. FTP server to exchange files with my business partners and avoid storing sensitive data on 3rd party free mail servers
  3. Many web widgets to check market index like forex, bonds, stocks, etc.
  4. test html code
  5. run a script I made to check for mail, since I have many mail accounts, avoiding geo tagging lockouts
  6. run a simple blog (Nibble blog)
  7. work as a honeypot to spot (and block) hackers on my wire

just to name a few uses.

JohnBR
  • 31
  • 2
2

I fear you need to find out by your own. When i had this question for my RPi2, I stumbled over Siege and httperf. I followed this example to run the benchmarks - just instead of plain html pages i requested php files. There performance of the web server is also depending on the cgi modules you will choose. A plain vanilla lighttpd may be faster than a vanilla Apache. If you are choosing/configuring the CGI improper, this might be change and the Apache can outperform the Lighty.

Joe Platano
  • 852
  • 8
  • 19