/ azure

Scaling WordPress on Azure with PaaS - Part 3

Almost done! Now we just need some CDN action to wrap things up.

Configuring Azure CDN
During this step, we will configure the Azure CDN to offload static data to different endpoints around the world, so users will be able to experience a faster load time when visiting your site.
From the Resource Group blade, click Add and then in the search box, type CDN.

Select CDN by Microsoft and then click Create.
Complete the fields as below.

  1. Name - Provide a name of your choice.
  2. Subscription will auto fill in from your trial subscription.
  3. In Resource Group, select Use Existing and select the Resource Group you created earlier.
  4. Pricing Tier – Select Standard Akamai
  5. Select the checkbox “Create a new CDN endpoint now”
  6. CDN endpoint name – choose a globally unique endpoint name and note in in Notepad. It will take the form of http://.azureedge.net
  7. Origin Type – Select Web App
  8. Origin hostname – select your Azure Web App for Containers instance (WordPress) from the choices.
  9. Press OK.


This process normally takes about 15 seconds to complete. You can then open up the CDN Profile from the Resource Group blade. It should look like the below.

We need to modify the endpoint to remove support for HTTPS as we’re not configured for HTTPS on the WordPress portion of the Web App. Click the endpoint name under HOSTNAME in the middle of the blade and then Click origin.

Untick the box for HTTPS and click Save. Next, click Compression and enable Compression and click Save.

Finally, open a new browser tab to http://.azureedge.net. You should see your website!

Scaling Your Application
Scaling can be provided at various portions of your application based on load and throughput requirements. Some examples of scaling options include:

  1. Vertical Web App Scaling – this involves increasing the SIZE of the WordPress instance – i.e. adding more CPU or memory. This is done by opening up the Web App and clicking Scale Up


Then select the appropriate amount of compute capacity you need.


  1. Horizontal Web App Scaling – this involves increasing the NUMBER of hosts hosting your application – i.e. adding more servers. This is done by opening the Web App and clicking Scale Out

Then select the number of instances needed.

Note that you can also enable autoscale from here, whereby your Web App scales based on the performance metrics (CPU, Wait Time, Memory Pressure, etc) automatically or by a schedule. Azure handles the load balancing for you!

  1. Next, you can scale the MySQL database server by opening it from the Resource Group blade and selecting the appropriate pricing tier. This will give you additional storage or compute to handle large volumes of posts.


  1. Next, you may find that your static collection cache is overloaded and therefore you can scale the Redis Cache to provide more in memory capacity. Similar to other resources within Azure, you can do so from its blade by clicking Scale and then choosing another pricing tier.


There are a lot of ways to skin this particular cat. In the next part of the series, instead of using PaaS, I will switch to IaaS, where we'll learn more about the underpinnings of Azure and template deployements. Until then! :)