Google Cloud serverless function object access is four times faster than AWS

AWS S3 is four times slower than Google Cloud Services when serverless functions access object storage.

So says LightStep Research in a report seen by Blocks and Files entitled “How Google Cloud Storage processes cloud functions 4x faster than Amazon Web Services.”

Auther James Burns points out that serverless functions in the cloud are stateless and get their data either from data passed to the function at call time or from an external data store accessed over a network.

He looked at a serverless Google Cloud Function in Google Cloud Services and traced the time it took to initiate a connection to an object datastore in GCS and also AWS S3, and then fetch data.

A connection request made from REST APIs secured with Transport Layer Security (TLS) involves four network round trips. There are three to set up the connection; TCP SYN, TLS Client Hello, and TLS Change Cipher Spec, and then a fourth, HTTP GET, to retrieve the data.

Total connection time in a data centre is single to double digit milliseconds. If the data is in another data centre or a cloud provider, a round trip can take tens to 100s of milliseconds.

If an existing connection can be re-used three round trips are saved and the total time is quicker. The less time taken the faster the function executes.

With AWS, Burns found the initial connection setup was followed by re-use, saving time. But with GCS the initial connection re-used an existing one (so-called connection re-use insertion) and so more time was saved.

Burns concluded Google Cloud Functions’ reusable connection insertion makes the requests more than four times faster both in-region (same data centre) and cross-region (remote data centre) accesses. Here are his numbers;

In-region total:

  • GCS – 37ms
  • S3 – 156ms

Cross-region total:

  • GCS – 216ms
  • S3 – 909ms

The takeaway here is that serverless functions referring to external object datastores should execute faster in the Google Cloud than AWS. 

LightStep Research was set up by ex-Google microservices people to provide performance management services for microservices and serverless cloud applications.