High Performance WordPress on the Cheap

Shared Hosting

Typical shared web hosting plans can be a cheap and easy way to host a WordPress blog, but I’ve found performance on all the ones I tried to be abysmal. WordPress.com may also be an alternative, but this cloud approach I’m going to detail should give you better performance and still be cost-effective. Another approach not discussed here is dedicated hosting, which can also perform, but is usually expensive.


When I created this blog, I knew I would be hosting a lot of videos and images and wanted good performance. My previous experiences with Amazon Web Services showed me that clouds and CDNs (Content Delivery Network) make a very noticeable difference. When I say “high performance”, this should perform well for a few concurrent users. Compared to shared hosting, it should be easy to see the difference in load times. If you have a lot of traffic on your WordPress site, you may need to pay for more powerful virtual servers ( RAM, CPU ) and more of them in order to keep up (you’ll see options for this later). In any case this approach is better than shared hosting, as well as a shared / CDN combo.

What’s Best for WordPress

Normally with AWS, I would create Elastic Beanstalk PHP applications and update them with Git every time I made changes, like in my game. In this case, I wanted a server where I could log in from the blog site, make updates, preview, and publish. That gets a bit more complicated with Beanstalk since you can’t make changes to the server’s “ephemeral” disk the way you would on a shared hosting plan. Thats because virtual servers (EC2s) lose their changes every time they are terminated, and in Elastic Beanstalk they are created and terminated on the fly to accommodate traffic. See this article if you want to get more technical.

I did find a good solution which is basically free for 1 year, and about $15/mo after that. It’s a combination of these parts:

  1. An Amazon Web Services account (free tier for 1 year)
  2. Bitnami Cloud Hosting, with their WordPress app installed
  3. Access to the zone records for your domain (optional, if you want to assign domain names to your blog and your CDN)

Amazon Web Services

If you haven’t signed up for AWS you can take advantage of their free tier. If your site isn’t wildly popular and doesn’t have a ton of traffic, it should cost between nothing and under $1 per month in the free tier. After signing up, look for AWS Management Console or Services  and Security Credentials.  You’ll need these for Bitnami and the CDN we are going to create. In the image above, we are going to use S3 and CloudFront for the next section.

Make Your CDN

Your CDN is where you will put all your images, video, sounds, etc that slow down loading. In your blog posts you should insert media with full http urls to their CDN locations, rather than on the server that contains WordPress. This will make a huge difference in wait times for loading content and media.

There are other ways to do this but I will detail the steps I used.

  1. Create an S3 Bucket
    1. In the Service menu, go to S3
    2. Click on Create Bucket and give it a name, then click Create
    3. Upload a file or some files into the bucket. Select your uploaded files and choose Actions > Make Public. This is necessary to make the files accessible
  2. Create a CloudFront distribution from your bucket
    1. In the Service menu, go to CloudFront
    2. click Create Distribution and choose Web and then continue
    3. click in the Origin Domain Name and you should see a pulldown. Choose the S3 bucket we just created
    4. If you want to add a custom domain name, like “cdn.arnoldbiffna.com”, you can do it in  the Alternate Domain Names (CNAMEs) field. You’ll need access to your domain’s zone records to point to the domain about to be created from this form
    5. scroll down to Default Root Object and type in “index.html” or “index.htm” if you have folders of static html content you’d like to put on the CDN
    6. click on Create Distribution
    7. In the list of CloudFront distributions, you should see a domain name like d123xyz213987iu.cloudfront.net. The first of three parts “d123xyz213987iu” will be something unique to your CDN. If you uploaded a file say, “logo.jpg”, you’d now be able to access it as d123xyz213987iu.cloudfront.net/logo.jpg.
    8. If you want to use a custom domain name like “cdn.arnoldbiffna.com”, map a cName to the one we just created in your domain’s zone records. Then you could access your files like cdn.arnoldbiffna.com/logo.jpg. You might have access to this in the settings for your web hosing or domain management.

What you’ve now done is created a CDN. What ever you put in your S3 bucket will get copied to several “Edge” locations around the world for faster access to all your users. Keep in mind with CDNs, you should not update your files, simply upload new versions with different names.

 Create a Cloud Hosted Server with WordPress on Bitnami

Next, you’ll want to create a free account at Bitnami. What we are going to do is use your Security Credentials from AWS to launch a pre-built server with WordPress added on.

  1. To begin, click on Console
  2. click Create a Server
  3. Next, enter in your AWS Security credentials: your Access Key ID and Secret Access Key. You can find these in your AWS account in the main menu under Security Credentials
  4. Choose a Default Location closest to the majority of your audience. The default choice (U.S. East Coast Virginia) is free but the others may cost more. The N California location is closest to Los Angeles, but I chose Oregon as it was much cheaper, and relatively close.
  5. Make a password and continue.
  6. In the New Server dialog, begin by giving it a Name. It should match the Domain Name that will be yourName.bitnamiapp.com
  7. The first option I changed is the default Operating System, Ubuntu. I switched to a 64 bit Amazon Linux, because I think Ubuntu has a lot of extra services and features I won’t be using. My theory is that the  Amazon Linux should perform slightly better.
  8. Next, I clicked on Add New Application and searched for wordpress. Click the checkbox and OK.
  9. Now, click on Application Options and fill out the information in both tabs. The Email Configuration is important since WordPress will use this for notifying you of comments, as well as using contact forms and other communications. I used the SMTP info for Yahoo for my email.
  10. Optional – the options under Micro will allow you to add more power ( and costs ) to your server. This would be useful if you will be redirecting heavy web traffic here
  11. Click on Build and Launch
Server Management

In a few minutes you should be able to access your blog. Bitnami’s Dashboard has several options for managing your server afterwards, such as adding a custom domain, adding other apps than WordPress, and making backups.

I recommend backups. They may incur a small cost ( under $1), but if you are putting hard work into your blog, it would be nice to restore not only the content, but all your server and app settings, plugins, etc as well. If you want to map a custom domain like I did in the image above, you will need to access your domain zone records. Notice I also made a subdomain for the CDN, which comes in handy if you want to switch CDN providers in the future.

Now the images and videos in my blog posts can come from cdn.arnoldbiffna.com/someimage.jpg instead of the default, cryptic domain names. Also, in the future, I can use a different CDN provider and not have to change my blog urls.

SlotFriendzy Game – a Passion Project

In 2012, I had a dream of making a successful slot machine game on Facebook. I spent about 6 months on it during my off-time from work. I even formed a Delaware company to own the game  – called Mookie Games Inc.


The idea of the game was to have a slot machine where the slot items were your friends. It used the Facebook API to grab their profile pictures and basic info about them. You could also launch their profiles from the pictures.
You were given a certain number of coins to begin with, and over time if you ran out, you could purchase more. You could adjust your bet, and the number of pay lines you wanted to bet on. Increasing the pay lines also increased your chances of winning, but increased your wager.
Like real Vegas slot machines, logic was in the game to control your odds of winning, and eventually lead you to making a purchase. I also added lots of free play options such as getting bonuses for each friend of yours that played the game, and how often you and your friends played. Other features such as posting screen captures of your wins, messages on your Facebook wall, and bulk invitations to friends were utilized to make it more viral.

Cloud Deployment

Hoping the game would get used by millions, I decided to learn how deploy cloud based apps using server stacks, virtual machines, load balancers, and distributed databases. I began with Facebook’s default host, Heroku, and then ended up on Amazon Web Services (AWS). I also did research and experimented with others such as App Fog, Google App Engine, and Micorosft Azure.
I picked AWS because of the autoscaling feature. The game was deployed using Git, which would get pushed up to EC2 Virtual Machines behind a load balancer. If the game got heavy usage, more EC2 VMs were automatically launched to handle the load, and then terminated when usage decreased.

Deployment was similar on Heroku, except for the Auto Scaling. I could switch back and forth between Heroku and AWS with the way I had the app set up, using Environment Variables and PHP. I just had to change the url settings on Facebook.


All Flash swfs, images, and sounds were uploaded to an AWS S3 Bucket. I set up an AWS Cloudfront distribution which used that bucket to copy and cache local versions around the world. This was important as I was doing Facebook advertising for my game in several other countries, and I needed the game to have good performance world wide.


Both AWS and Heroku apps were using a cloud Database from a company called Xeround ( no longer in business ). An alternative today could be ClearDB. This is basically a cloud hosted mysql endpoint that has synchronized copies hosted around the world, for better performance. Much of the games features required the use of SQL queries, so I chose MySQL over those no-SQL alternatives.


The server side language for this app was PHP. It used the PHP APIs for Facebook and AWS S3, but most of the PHP was in AMFPHP service classes to handle database operations and communication with Flash. A gambling transaction api was created in the process that had 2 way encryption between the PHP and Flash, and prevented game cheating.

Front End

The Flash App was my largest ActionScript project ever. I proudly architected some clean reusable MVC OOP code that made it easy to invent, integrate, and update features. The graphics assets were from Flash CS6 and published as SWCs, and Flash Develop was the main IDE for coding.

The End

Even though users were making purchases in the game, it never hit a point where it became profitable. Also, a company in the UK claimed the game’s name was too similar to theirs. Facebook never saw a resolution to the dispute and simply shut down the game. All in all, at its peak, the game had over 25,000 users, and was a joy to develop. It allowed thousands of retirees to gamble on the cheap while seeing pictures of their loved ones 🙂