Choosing to compute resources

  1. Home
  2. Choosing to compute resources

Go back to GCP Tutorials

In this tutorial we will learn and understand about the compute resources.

Compute

  • Firstly, most solutions use compute resources in some form, and the selection of compute for your application needs is critical. However, on Google Cloud, compute is offered as Compute Engine, App Engine, Google Kubernetes Engine (GKE), Cloud Functions, and Cloud Run.
  • Secondly, compute Engine provides graphics processing units (GPUs) that you can add to your virtual machine instances and to accelerate specific workloads on your instances.
  • Thirdly, App Engine supports container deployment, allowing for easier and quicker migration. And, it can also support hosting microservice architectures with multiple services.
  • Further, when you need more administrative control, Google Kubernetes Engine is the recommended option. GKE is great for complex microservice architectures that need additional services such as Istio for service mesh control.
  • Next, you can use Compute Engine for deploying your application, because you can build and run any custom VM images.
  • Lastly, Cloud Functions lets you build automation code that lives for a short duration and can perform actions in a scalable fashion.
Key services
  • Firstly, Compute Engine delivers virtual machines running in Google’s innovative data centers and worldwide fiber network. Compute Engine’s tooling enables scaling from single instances to global, load-balanced infrastructure. Compute Engine VMs boot quickly, come with high-performance persistent and local disk options, and deliver consistent performance.
  • Secondly, Google Kubernetes Engine provides a powerful cluster manager and orchestration system for running your Docker containers. GKE schedules your containers into the cluster, keeps them healthy, and manages them automatically based on requirements you define (such as CPU and memory).
  • Thirdly, App Engine is a platform for building scalable web applications and mobile and IoT backends. App Engine provides you with built-in services and APIs, such as NoSQL datastores, memcache, and a user authentication API, common to most applications.
  • Next, Cloud Functions is a serverless execution environment for building and connecting cloud services. With Cloud Functions, you write simple, single-purpose functions that are attached to events emitted from your cloud infrastructure and services.
  • Lastly, Cloud Run is a managed compute platform that enables you to run stateless containers that are invocable through web requests or Pub/Sub events.

Creating a VM Instance with a custom machine type

Compute Engine offers predefined machine types that you can use when you create an instance. A predefined machine type has a preset number of vCPUs, and amount of memory, and are charged at a set price as described in the All pricing page. However, if predefined machine types don’t meet your needs, you can create an instance with custom virtualized hardware settings. Specifically, you can create an instance with a custom number of vCPUs and amount of memory, effectively using a custom machine type.

Creating an instance with a custom machine type

Before you create an instance, make sure you read and understand the Specifications for creating a custom machine type.

  • Firstly, in the Google Cloud Console, go to the Create an instance page.
  • Secondly, under Zone, select the zone where you want to host this instance. This filters the list of machine types only to those that are available in that zone.
  • Thirdly, under Machine configuration, select General-purpose.
  • Then, from the Machine family list, select N1 under First Generation for N1 custom machine types or E2, N2, or N2D for Second Generation custom machine types.
  • After that, from the Machine type list, select Custom.
  • Next, drag the sliders to choose the number of vCPUs and the amount of memory for the instance. The console displays an estimated cost for the instance as you change the number of vCPUs and memory.
  • Lastly, save your changes and continue with the rest of the creation process.
gcp cloud architect practice tests

Adding extended memory to a machine type

Depending on the machine type, each machine type can have up to a specific amount of memory by default. For example, if you create a VM with an N1 custom machine type, the VM can have up to 6.5 GB of memory per vCPU. For N2 custom machine types, this number goes up to 8 GB of memory per vCPU. However, for some workloads, this might not be enough memory. At an additional cost, you can get more memory per vCPU beyond the default limit. This is referred to as extended memory.

Further, with extended memory, you can add memory to a machine type with no limitations per vCPU. You can add extended memory up to certain limits based on the machine type:

  • Firstly, for N1 machine types, you can add up to a total of 624 GB of memory per VM.
  • Secondly, for N2 machine types, you can add up to a total of 640 GB of memory per VM.
  • Next, for N2D machine types, you can add up to a total of 768 GB of memory per VM.
  • Lastly, extended memory is not available for E2 machine types.

Incase, if you require more memory, you must use one of the mega-memory machine types, which allow you to create instances with a total of 1.4 TB per VM instance.

Determining if you need extended memory

Certain workloads need more than the default amount of memory per vCPU to deliver optimum results. Workloads that are based on in-memory analytics, high performance databases, including relational and NoSQL databases such as MS SQL Server, MongoDB and MemcacheD/Redis, fall into this category. vCPU-based licensing of operating systems and software stacks also make selecting an optimal VM memory configuration more challenging with predefined machine types. By using extended memory, you can add as much memory as you need to reach the best price and performance for your VM instances.

Choosing to compute resources GCP cloud architect  online course

Reference: Google Documentation, Doc 1

Go back to GCP Tutorials

Menu