Skip to content

performance

How to build your own WPEngine copycat WordPress server on Ubuntu 14.04 with an Ansible Playbook

There is no denying that WPEngine offers the fastest WordPress hosting on planet earth. They’ve invested millions into building the fastest platform possible. That’s why they charge so much money for their services. Because they are worth it. Some of us can’t afford to pay $100-$1000/mo for WordPress hosting. The good news is that if you’re not afraid to get your hands dirty on a Linux command line, you can build your own server that will get you most of the way to a WPEngine class WordPress instance. There are a few key technologies that make this possible.

  • Percona DB (like MySQL)
  • HHVM – A super fast PHP VM
  • PHP-FPM – Just in case HHVM has a problem
  • NGINX
  • Varnish – Awesome reverse proxy cache
  • Memcached & APC

I think you’re probably starting to get the idea. These are the highest performers of the high performance technologies out there. We’re going to make them all work together to make your site blazing fast. It’s not all that hard and it doesn’t take very long.

All you need is a VPS or Virtual Machine running Ubuntu 14.04. Go ahead and SSH into it and we’ll get started.

How to build a WPEngine copycat server for FREE

The server you are working with MUST be able to resolve the hostnames of the sites you’re going to set up, to itself. So, if you are building this to replace a server that’s running and you don’t want to take that site down until everything is migrated, simply add hostname entries mapping the FQDN to the IP address in /etc/hosts.

First thing’s first, let’s make sure your Ubuntu 14.04 installation is updated and upgraded.

sudo apt-get update && sudo apt-get upgrade

Now we need to add the Ansible ppa.

sudo add-apt-repository ppa:ansible/ansible

Click Here To Read The Rest Of This Post!

How To Build An INSANELY FAST WordPress Server On Ubuntu 14.04, Using NGINX, HHVM & MySQL

So, you want to build a WordPress server? One that won’t barf all over itself every time a link is posted to Digg or Reddit? Well, you’ve come to the right place. Building an insanely fast web server isn’t rocket science. It’s actually pretty darn straight forward. I’ve built more web servers than I care to remember, which means I’ve also made more mistakes I care to remember. All in the name of trying to make things faster. If speed is your goal, there’s only a few important key things to remember. If speed is absolutely the most critical variable in a situation, my philosophy is something like this:

  • KISS – Keep It Simple Stupid. Seriously… No control panels, plugins, or other bloated garbage.
  • Cache, Cache, and Cache some more. Caching is a godsend. Reduces requests, reduces transfer time, therefore reducing load times!
  • FAST Server – This should be a given, but no shared servers. Only VPS, VM or bare metal awesomeness.
  • Optimization – Optimize, minimize, downsize, and compress everything as much as you can get away with.
  • Optionally, using a CDN (Content Delivery Network) can really speed things up; as well as a high quality distributed DNS service. But, not absolutely necessary.

Like I said, we’re talking about building an INSANELY FAST WordPress server here. Obviously if you’re Joe Shmoe from Motown, you can probably get by just fine on a quality managed hosting provider, like Serenity-Networks. But, if you want to build the fastest web server on earth, continue reading.

There are plenty of Linux Distributions out there that will work just fine. I prefer CentOS and Ubuntu. For this guide, I’ll be using Ubuntu 14.04 LTS (Long Term Support). This OS will be supported for many years, with security updates. That’s good, especially for a server. If you don’t have it, go to http://www.ubuntu.org and go to downloads, then server. Be sure to select the 14.04 LTS version.

Now, assuming you have done a minimal install of Ubuntu 14.04, with only OpenSSH selected for packages (for remote SSH connection, obviously), we will be using some commonly known building blocks to turn this into a very fast web server.

  • NGINX Web Server – Many THOUSANDS of the fastest sites in the world use it. It’s the best.
  • HHVM – This is a very high performance virtual machine that takes care of processing PHP (as well as HACK). Because it turns PHP into machine language, very quickly, it can really speed things up.
  • MySQL – Kind of boring, but every site needs a database, so we’ll use this one.

Getting Started

Click Here To View The Entire Tutorial!

Simple Method to Benchmark Disk Read & Write Speeds From the Linux Command Line

Recently, I’ve been exploring high availability iSCSI targets and using them as virtual machine storage. I have always been a bit weary of iSCSI performance over gigabit networks due to some not-so-great experiences many years ago. iSCSI technology has progressed quite a bit since then. FreeNAS has an excellent implementation of iSCSI, as well as Nexenta. I wanted to get a good grasp on how well everything was performing, so I decided to run some basic benchmarks.

The virtual machine I’m working with has Ubuntu 15.04 installed, but these commands will work on just about any linux distribution in existence. The hyperviser is running VMware ESXi 6, with this particular virtual machine stored on an iSCSI target served from a FreeNAS virtual machine running on another VMware ESXi hyperviser. The FreeNAS virtual machine has been given PCI Passthrough to a 3ware 9650SE-16ML, connected to 4x1TB Hitachi SATA Hard Drives exported as JBOD (individual drives, no RAID). FreeNAS configured a RAID10 with the four drives, which is where the iSCSI target resides. The network is gigabit, with an Adtran NetVanta 1524ST switch. I have not enabled Jumbo Frames. The theoretical maximum transfer speed on a gigabit network is about 125MB/s. Of course, with the overhead associated with TCP/IP and iSCSI encapsulation, a single link should be a little less. Lets get started.

To test WRITE speed of hard disk using the DD command:

#  sync; dd if=/dev/zero of=tempfile bs=1M count=1024; sync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 10.8496 s, 99.0 MB/s

So, this command writes a bunch of zeros to a file called tempfile, with a size of 1024MB. If you want to use a larger test file, you can change “1024” to a higher number. For instance, changing 1024 to 10000 would write a 10GB temp file. This command only tests the write speed. As you can see, the reported write speed was 99MB/s, not too shabby.

Click here to view the entire tutorial