In previous article, I use GCP VM (GCE) to host my application, as single instance.
I look into scaling options like I did for Azure for GCP.
Repeat from Azure post, but one of the reasons why I recommend multi-instance is availability. There are two types of concerns.
- Hardware failure
- Software update
A group contains identical VMs and offer auto-scale. It uses instance template as seed image to add additional VM when load exceeds threshold. There are two types of managed instance groups.
All VMs runs in same group. This article
says "single failure events will affect only a single zone". Thus I assume it may cover software update, but I still have issue with hardware failure.
VMs run in multiple zones in a region. This should cover hardware failure too, unless entire region goes down.
GCP also offers load balancer but it gives more option than Azure.
- HTTP(S) load balancing: Distributes HTTP(S) traffic among groups of instances based on proximity to the user, the requested URL, or both.
- SSL Proxy load balancing: Distributes SSL traffic among groups of instances based on proximity to the user.
- TCP Proxy load balancing: Distributes TCP traffic among groups of instances based on proximity to the user.
Distribute network traffic in one region
- Network load balancing: Distributes traffic among a pool of instances within a region. Network load balancing can balance any kind of TCP/UDP traffic.
- Internal load balancing: Distributes traffic from Google Cloud Platform virtual machine instances to a group of instances in the same region.
Enough talk, now let me try.
To start off, I need to create windows image which contains application.
2. Open PowerShell as administrator and run following command.
3. Go to "Images" and click "CREATE IMAGE".
4. Specify necessary parameters. Set source as Disk and source disk which you just generalized. Click "Create".
Next, create instance template from the custom image.
Now, as I have template image, I go ahead to create instance group.
When autoscaling kicked in, there are multiple instances. To give users single access point, add load balancer.
6. Now I can click "Create" button.
7. I use default rules and configuration for the rest. Click "Create" to create the load balancer. Wait until creation completes.
As I am using Free trial account, there are certain quota that I cannot exceed. If I keep accessing the endpoint and let keep auto scale happen, then I exceed my limitation.
The way it auto scale is similar to Azure, such as creating seed image and set auto scale, with load balancer in front. However there are several differences how each cloud platform treats VMs.
As a developer, I feel Azure gives me better documentation, but GCP gives me better experience to configure scaling environment especially when using custom image.
There are tons of other features I may need to look at, but I move on to different technology from next article. Either function or container.