Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Google Cloud Compute API Response Time

aso
Bronze 1
Bronze 1

I'm new to Google Cloud API, and just made a script which uses the google-cloud-compute Python SDK to communicate with Cloud API.   Yesterday the response time for list(), get(), insert() functions were less than 5 seconds each.  Today, the response time is between 3 to 5 minutes per response!  Is this type of fluctuation usual?  Or am I being throttled?  Has anyone else experienced this?  I'm concerned because my customers can't wait 20 minutes for a script to finish which should not take more than a few seconds...

0 3 386
3 REPLIES 3

What I think might be the next steps is to look at the individual API calls that are being made.  Google Cloud has MANY API calls.  Some are quick and some are longer.  Without knowing which specific API call is being made there is little guidance we can offer.  Same is true for throttling and quotas.  Without knowing which of the many Google Cloud services you are invoking, there isn't much advice that can be offered.  Let me suggest posting back with more details of your API requests ... specifically, which service are you calling and any pertinent parameters you are passing in.  Remember, this is a public community so do NOT post anything you don't wish to be in the public domain.

Hi kolban

Im using these classes

NetworksClient

MachineTypesClient

ResourcePoliciesClient

InstancesClient

FirewallsClient

The flow of the script is to set up network and firewall settings, find a stopped VM which meets the current compute needs, if one cant be found, spawn a new VM.

The get() calls take no less than 2 minutes each and the InstancesClient.insert() call takes no less than 5 minutes.

aso
Bronze 1
Bronze 1

Hi kolban

The calls are

 

compute_v1.FirewallsClient.get
compute_v1.FirewallsClient.list 
compute_v1.FirewallsClient.insert
compute_v1.NetworksClient.get
compute_v1.NetworksClient.list 
compute_v1.NetworksClient.insert
compute_v1.MachineTypesClient.get
compute_v1.MachineTypesClient.list 
compute_v1.MachineTypesClient.insert
compute_v1.ResourcePoliciesClient.get
compute_v1.ResourcePoliciesClient.list 
compute_v1.ResourcePoliciesClient.insert
compute_v1.InstancesClient.get
compute_v1.InstancesClient.list 
compute_v1.InstancesClient.insert 
 
The overall flow is to determine the correct size for a C2 or C2D compute engine cluster, based on desired vCPUS, and to fetch existing parameters, or create new ones if they don't exist, which support the HPC guidelines Google has, such as using a VPC with high MTU value.  The main node's firewall allows access on certain ports so it can communicate with another server which orchestrates everything programmatically when the HPC MPI script is running.... But so far, I have only spawned at most 2 instances at once for testing.  I just started using Google Cloud a couple days ago.
 
Each call is taking more than 2 minutes.  The compute_v1.InstancesClient.insert call is taking well over 5 minutes.