Tag Archives: Nginx

Running several sites on a Banana Pi server

I’ve been doing some work on Pyplate CMS.  I’ve upgraded it so that I can run several sites on a single server, and I’ve also added support for MySQL to Pyplate.  I’m calling the new version Pyplate Multi-Site.

Now I can create a very simple mass blogging system on my Banana Pi cluster by installing Pyplate Multi-Site on each server in the cluster and make sure that they are synchronized.  This is an improvement on the Raspberry Pi cluster which can only serve one site.

I haven’t released the updated code yet.  I need to do more testing and update the Pyplate installation scripts.

So far I have only tested Pyplate Multi-site with Nginx.  If I want to use it with Apache, I will need to use mod vhosts in order to set a different web root folder for each site.  I haven’t tested it yet, but I will over the next few weeks.

In the short term I need to keep working on the Banana Pi cluster and get the upgraded version of it online so that I can start building some new sites.

Pyplate now works with Nginx

I’ve written an install script that installs Pyplate for use with Nginx.  You can read the instructions here: http://www.pyplate.com/install-pyplate.

I’ve set up a Pyplate forum so that you can ask questions about Pyplate and get help with any technical issues.

Nginx v Apache

I finally got around to doing some testing with Nginx.  I’ve written a description of how I set up Nginx on a Raspberry Pi.

I did a comparison of Nginx and Apache to see which would provide the best performance for my site.  Nginx was fastest for static content and dynamic content.

I want to deploy Nginx on my cluster, but first I have to figure out some issues with cache headers.  Hopefully I’ll get that worked out in the next few days.  I’ve posted a question about it on stackoverflow: http://stackoverflow.com/questions/19995097/setting-the-expires-header-stops-nginx-passing-requests-to-uwsgi

The makers of the Pi Face interface board have built themselves a new site.  They’ve linked to my site on this page – look for the picture of the robot buggy:  http://www.piface.org.uk/products/piface_digital/



My Raspberry Pi cluster was featured on Hackaday.com

A few days ago Hackaday featured an article about my Raspberry Pi cluster:  http://hackaday.com/2013/11/05/can-an-8-node-raspberry-pi-cluster-web-server-survive-hackaday/

The article was published at 12.00GMT, and my cluster served 2,440 pages in the first hour. In 12 hours, my site served 21,000 pages.

I checked the load on the load balancer and the backend servers, and everything seemed to be fine. This is the most traffic my site has had to handle so far, and I was pleased with the way it went. Page load times stayed low, and the cluster still had plenty of spare capacity.

Feedback was generally good. Some people questioned whether I really need an eight node cluster. I guess I don’t need eight Pi servers, especially for the amount of traffic my site is currently handling.

There are some dynamically generated pages on my site, and serving these pages uses a disproportionate amount of CPU time. I will probably add more dynamic content in the future, so I believe it’s a good idea to have some spare processing power.

It’s also important to consider that visitors don’t arrive on my site at evenly spaced intervals. If someone tweets a link to my site, there may be a rush of visitors in a short space of time, so the cluster needs to be able to handle spikes in traffic.

Some people left comments suggesting that my internet connection could be a bottleneck, and my internet connection will choke before the cluster gets overloaded. This seems like a reasonable point. If this becomes a problem, I may need to upgrade my internet connection.

Over the last few days I’ve been working on setting up uWSGI with Nginx. Everyone says Nginx is much faster than Apache when serving static content. Most of the pages on my site are cached, so it will be interesting to see how well Nginx performs with the CMS that I’ve written. I’ll write an article about Nginx and uWSGI in a few days.