Running Your Websites in VM Instances in the Cloud

Introduction

Among the many workloads companies are considering moving to the cloud are websites and web apps. While most cloud service providers (CSPs) offer options for website hosting via platform as a service (PaaS) or software as a service (SaaS), these are not the best options for all situations. You might have existing sites that don’t meet the requirements for these services, so you would have to alter them to make them fit. Or you might want the more direct control over performance and scaling that you get with an infrastructure-as-a-service (IaaS) environment. For these and other reasons, companies choose to host their web applications on VM instances on the cloud. In this post, I’ll talk about doing this on two CPSs, Azure and Google Cloud. I’m not going to compare the two CSPs; many factors go into choosing a provider and that goes beyond the scope of this blog. Instead, I’d like to share a bit about our experience testing various Intel CPU generations with website benchmarks on these CSPs.

VM instance sizing considerations

While your website may not have the same workload performance requirements as databases, for example, failing to meet website workload requirements could have severe consequences. If your site can’t handle peak traffic, you might lose sales and customers. This makes it vital to ensure your VM instance can deliver the performance you need.

Azure

Like many CSPs, Azure categorizes their VM offerings to help guide customers to the right size for their workload. At the highest level, Azure offers resource-based categories such as Compute-optimized and Storage optimized VMs. They also offer use-case categories such as General purpose and GPU VMs. Your first step is to decide which of these categories you wish to use. During our testing, we used a WordPress-based OSS benchmark to measure the performance of VMs from the General purpose and Memory-optimized categories.

Your next step is to choose the VM series that best fits your performance needs. Let’s select the general-purpose category and walk through the decision-making process for a hypothetical website workload that sees moderate levels of user traffic. Within the general-purpose category are several series of VMs, ranging from the Av2-series that Azure recommends for dev and test servers to the Ddsv4-series that they target for most production workloads.1 Multiple D-series VMs are available, though many are older generations of the same VMs. Because we need a VM rated for a production workload that provides enough resources to manage our moderate workload, let’s look at the Ddsv4-series. Based on 2nd Gen Intel Xeon Scalable processors, this is the latest version of the D-series generally available. (A v5 version of the series backed by 3rd Gen Intel Xeon Scalable processors is in public preview at the moment.) While you may be tempted to go with one of the less-expensive older D-series, WordPress tests show that the Ddsv4-series improves performance by up to 1.51x compared to the Dsv3-series.2 At the time of testing, the newer VMs cost only 1.17x as much, so you could get a better value with newer VMs.

Now we’ve narrowed our selection to the General purpose Ddsv4-series, we need to determine the correct VM size. The Ddsv4-series offers seven VM sizes, with vCPU counts ranging from 2 to 64. As the number of vCPUs increases, so does the amount of memory available, the limits on the number of disks you can attach, the disk bandwidth you get, and more. For our website of moderate size and traffic, either an 8- or 16-vCPU VM (with 32GB and 64GB memory, respectively) would likely suit our needs.3

Google Cloud

Let’s walk through a similar exercise on Google Cloud using a different hypothetical website. This time, it’s a small employee-facing website that experiences a small and steady amount of traffic.

As before, our first task is selecting a machine type. Among the VM categories, Google Cloud offers are general-purpose, compute-optimized, and memory-optimized. Browsing through the machine types, we see that the memory-optimized VMs are for very large memory needs, with the smallest VM containing over 5 TB of memory—this is definitely more than our website needs. We could choose compute-optimized VMs, but our small website doesn’t fall into the compute-intensive workload category for which Google Cloud recommends these VMs.

Let’s look at the general-purpose VMs. According to Google Cloud documentation, a web server would best fit with E2 or N-series VMs.4 Both series are backed by several different CPUs of varying generations and architectures. However, Google Cloud cautions that users cannot control the processor type of the E2 series VMs. This may not be an issue if you only have one site, but if you have more, or if you regularly take your site offline for maintenance, you may want to control the CPU type for consistent performance. In that case, we’d suggest the N2 machine type backed by 2nd Gen Intel Xeon Scalable processors. In fact, in our WordPress tests, a small 4-vCPU N2 VM supported 1.36x more requests per second than a 4-vCPU N1 VM.5 That means your performance will likely be better and more consistent with the N2 VM.

Now that we’ve decided on the general-purpose N2 series, the last decision is VM size. For our small site with a slow steady stream of access, a 2- or 4-vCPU VM should be good. However, one thing worth noting for any website VM is the network bandwidth limits. If your website hosts a large volume of data that users download—for example, a large volume of self-hosted videos that users stream—you might need to size up your VM to ensure that the bandwidth caps will be sufficient.

Additional considerations

In our experience with Azure and Google Cloud, we picked up some tips regarding choosing the right VM for your website workloads.

Azure

First, all Azure series now support Generation 1 Hyper-V VMs, but only some series support Generation 2. If Generation 2 features—including Intel Software Guard Extensions (Intel SGX), virtualized persistent memory (vPMEM), or faster boot times—are important to you, be sure to choose a VM that supports Generation 2.
Second, Azure storage support can differ from series to series. They offer several tiers of block storage to attach to their VMs, but not all VMs support some of the high-performance disk tiers such as Premium Storage. Many considerations can factor into choosing a VM, so be certain to read through all the limitations, sizes, and features available on the VM you’re considering so you can avoid any surprises down the road.

Google Cloud

When I discussed the VM instance series sizes that Google Cloud offers, I focused on the standard VM sizes. I’d like to mention two important things about Google Cloud series VM instances. First, for many series, variations of the standard VM are available. For example, while the general-purpose N2 series starts with n2-standard-<vCPU #> VMs, they also offer high-memory versions that have the same vCPU counts but twice as much memory as the standard VMs. These VMs let you optimize memory for smaller workloads that don’t need the 5TB and increased RAM of the memory-optimized M2 series. Additionally, you can get high-CPU versions of the N2 VM instances that go the other way: They offer less memory per CPU for workloads that have a high CPU load but lower memory requirements. Keep these alternative versions in mind when looking for the right mix of resources for your websites.

So far, all of the VM instances we’ve discussed are the default VM instance builds that Google Cloud offers. If these pre-defined machines, even with all the varieties offered, don’t quite fit the needs of your workload, Google Cloud offers Custom Machine Types. Custom Machine Types based on the E2, N2, and N1 general-purpose series allow you to customize the CPU and RAM on each machine. There are some rules, mostly around the ratio of memory to CPU requirements for each Custom Machine Type, but this gives Google Cloud customers the flexibility to select the CPU and memory ratio that best fits their workload.6

Multi-tier web apps

What about more complex web applications? The cloud is great for those, too. As containers continue to increase in popularity, many companies are moving web apps and other multi-tier applications to containerized solutions. Both Azure and Google Cloud offer robust container solutions including their Kubernetes services, Azure Kubernetes Service (AKS) and Google Kubernetes Engine (GKE), respectively. Both offer customers a fully managed Kubernetes environment to easily create new or shift existing containerized applications to the cloud.

Here at Intel, we ran a Kubernetes benchmark called Weathervane, developed by VMware, that creates a multi-tier web app in a Kubernetes container cluster. Weathervane measures cluster performance by testing how many Weathervane users the cluster can support without breaching a set of pre-determined quality-of-service requirements. The web app mimics an auction site where users can peruse items and place bids. Our goal was to show that even in a containerized environment, the underlying hardware you choose to host the containers has an impact on performance. For example, in our tests, a cluster of D8s_v4 VMs (backed by 2nd Gen Intel Xeon Scalable processors) supported up to 1.58x the Weathervane users of an older D8s_v3 cluster.7 To read more about our testing, you can check out the blog we wrote here.

Conclusion

Running your websites and web apps on VMs in the cloud offers many advantages, but also involves making a lot of decisions, some of which can be confusing. I hope that I’ve given you a general sense of the kinds of considerations to keep in mind as you explore your options and that you’ve gained some insights specific to Azure and Google Cloud that will help you work with those providers.

[1] https://docs.microsoft.com/en-us/azure/virtual-machines/sizes-general
[2] https://www.principledtechnologies.com/Intel/Xeon-8272CL-Microsoft-Azure-WordPress-0920.pdf
[3] https://docs.microsoft.com/en-us/azure/virtual-machines/ddv4-ddsv4-series
[4] https://cloud.google.com/compute/docs/machine-types#recommendations_for_machine_types
[5] https://www.intel.com/content/www/us/en/partner/workload/google/n2-instances-1pt42x-wordpress-as-n1-benchmark.html
[6] https://cloud.google.com/compute/docs/machine-types#custom_machine_types
[7] https://www.intel.com/content/www/us/en/partner/workload/microsoft/158-users-on-kubernetes-azure-dsv4-benchmark.html

Notices & Disclaimers
Intel technologies may require enabled hardware, software or service activation.
No product or component can be absolutely secure.
Your costs and results may vary.
All product plans and roadmaps are subject to change without notice.
Intel does not control or audit third-party data. You should consult other sources to evaluate accuracy.
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.