1

While studying basic ML algorithms on MNIST database, I noticed that my netbook is too week for such purpose. I started a free trial on Google Cloud and successfully set up VM instance with 1 vCPU. However, it only boosts up the performance 3x and I need much more computing power for some specific algorithms.

I want to do the following:

  • use 1 vCPU for setting up an algorithm
  • switch to plenty of vCPU to perform a single algorithm
  • go back to 1 vCPU

Unfortunately, I am not sure how Google will charge me for such maneuver. I am afraid that it will drain my 300$ which I have on my account. It is my very first day playing with VMs and using clouds for computing purpose so I really need a good advice from someone with experience.

Question. How to manage namber of vCPUs on Google Cloud Compute Engine to compute single expensive algorithms?

GalloCedrone
  • 4,869
  • 3
  • 25
  • 41
Fallen Apart
  • 723
  • 8
  • 20

1 Answers1

1

COSTS

The quick answer is that you will pay what you use, if you make use of 16 cpu for 1 hour you will pay 16 cpu for 1 hour.

In order to have a rough idea of cost I would advice you to take a look to Price Calculator and try to create your own estimation with the resources you are going to use. Having a 1VCPU and 3.75GB of RAM machine running for one day cost around 0.80$ (if it is not a preentible instance and without any committed use discounts), a machine having 32 VCPU and 120GB of RAM on the other hand would cost around 25$/day.

Remember the rule: when it is running, you are paying it; you can change the machine type how many times you want according your needs and during the transition you would pay just the persistent disk. Therefore it could make sense to switch off the machine each time you are not using it.

Consider that you will have to pay as well networking and storage, but the costs in your use case are kind of marginal, for example 100GB of storage for one day costs $0.13.

Notice that since September 2017 Google extended per-second billing, with a one minute minimum, to Compute Engine. I believe that this is how most of the Cloud Provider works.


ADDING VCPU

When the machine is off, you can modify from the edit menu the number of VCU and the amount of memory, here you can find a step to step official guide you can follow through the process. You can change machine type as well through the command line, for example setting a custom machine type with 4 vCPUs and 1 GB of memory :

$ gcloud compute instances set-machine-type INSTANCE-NAME --machine-type custom-4-1024

As soon you are done with your computation, stop the instance and reduce the size of the machine (or leave it off).

GalloCedrone
  • 4,869
  • 3
  • 25
  • 41