conference wordpress site (part 2) – load testing and monitoring

In May 2016, a well motivated group of Toastmasters in Prague and Brno, teamed up to organise a “Toastmasters Leadership Institute” conference, in less than 2 months. In this mini series I explain the steps I took to get the web site up and running.

Fact: a conference site receives bursts of traffic driven by social media activity, and then sits idle for most of the day.

Load Testing

Our aim was to bring roughly 100 people to the TLI conference.

I estimated that our PR campaigns would drive about 40 visitors in the minutes immediately following our posts on Facebook. I wanted to verify that the response time of the site under such load would be reasonable (within 2 seconds?) . To do so, I created a test case in jMeter that would run 40 concurrent users, browsing every single page of the site. (how-to write a jmeter test case)

If you don’t want to learn jMeter (and all the stuff connected to load testing) , you can use loadimpact.com , which is able to run a simple load test in 5 minutes, returning a good-enough report.

Monitoring

Your web site will fail! Prepare for it.

One Sunday afternoon I was walking back home, when I received a notification on my phone : “The TLI web site is down”. I notified Lukas (the “responsible person” as he called himself) and Zuzana (our PR super girl) , letting them know that I would work on it in a few minutes.

Knowing that the site was down, we delayed a social media PR campaign that was bound to send tens of visitors to our pages.

Host-Tracker is an online service that periodically visits your site, and if the site is not responsive, it can send you a notification via email, SMS, voice call, or a number of web services. The free plan allows to monitor one site every 30 minutes. (how-to create an alert in host-tracker)

Why does this matter?

Have you ever clicked on a link that took forever to load? 3 seconds feel like an eternity. 10 seconds is just unacceptable! When you choose a platform on which to deploy your site, you need to know that it can serve your expected traffic within a reasonable time frame. Fail to do so, and you’ll lose your audience.

When your site goes down, you must be the first one to know about it. Next thing you do: you notify your team, so that they don’t try to showcase the site, or launch some PR action! Be in control of your site.

 

Part 1 – hosting and plugins

conference wordpress site (part 1) – hosting and plugins

In May 2016, a well motivated group of Toastmasters in Prague and Brno, teamed up to organise a “Toastmasters Leadership Institute” conference, in less than 2 months. In this mini series I explain the steps I took to get the web site up and running.

Fact: with less than 2 months to go and a tight budget, you can’t get fancy with the web site! This is why we decided to adopt WordPress.

Hosting

For this particular event I used Windows Azure (cloud offer by Microsoft) creating a Virtual Machine size A2 Basic, based on CoreOS, in the Frankfurt datacenter (closest datacenter to our main audience).

The A2 Basic instance (2 cores, 3.5 Gb RAM, 60 Gb disk, about 70$ per month) might seem pricy and oversized, but the site needed to stay up only for 2 months, with bursts of traffic driven by our PR campaigns.

CoreOS is a linux distribution that comes with Docker preinstalled. It makes sense to use CoreOS only if you want to run dockerized applications (like in this case). Otherwise, rather go with Ubuntu or CentOS.

WordPress has an official docker image, and in its documentation it also features a docker-compose yaml file to spin a MySql (MariaDB) container together with the WordPress container, linked and configured. You might want to change your password, and if you have some time, figure out how to add SSL support.

Make sure to tune the restart policy of your docker containers. The 2 outages I experienced could have fixed themselves had I set –restart unless-stopped (or always) .

How to deploy WordPress using Docker on Azure

Plugins & Theme

  • Theme – Zerif Lite : Clean, with a captivating landing page. Customisations require you to know CSS and HTML, and to understand PHP. I know nearly nothing about PHP, but after years of web development I’m pretty comfortable with spotting logical constructs 🙂
  • Sucuri Security – Auditing, Malware Scanner and Hardening : this security plugin contains a number of functionalities to reduce the attack surface of your WordPress site. WP sites are far to vulnerable to scripted attack. Hardening your installation is a sensible move.
  • WordPress Backup to Dropbox : this plugin will backup your site (code files, media and database) seamlessly to your dropbox account. This way, should your site fall for an attack, you will be able to restore it without having to rebuild everything from scratch. Be sure to practice the restore on another installation of WP! Not having backups is bad…not knowing how to use your backups is stupid!
  • Google Analytics : this allows you to inject the tracking code that Google Analytics uses to monitor the traffic that goes through your site.
  • All-in-One WP Migration : this plugin is designed to migrate your entire site to a new installation, with just a couple clicks. It can be an effective backup strategy, with fairly easy recovery.

 

Part 2 – load testing and monitoring