Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is europe-west much slower than us-central on Google Cloud Platform's AppEngine?

I did an experiment and installed the same application on Google Cloud Platform, with the same database, and the same buckets (for images) on 2 different locations: us-central and europe-west. However, the loading times are hugely different. I am in Spain, and surprisingly the us-central one is much faster.

Application info:

  • region: us-central VS europe-west
  • PHP 5.5

SQL (both the same):

  • MySQL First Generation master
  • MySQL 5.6
  • tier: D1
  • activation policy: on demand
  • Preferred location: follow app

Storage (Google Buckets):

  • Default storage class: Multi-Regional
  • Location: EU (for europe-west) and US (for us-central)

Loading times (after some refreshes for caching purposes):

  • us-central: 2.26s https://practia-delta.appspot.com/
  • europe-west: 9.96s http://gamma.practia.org/

The one in europe-west is so slow it is not practical. Why this difference? Or what did I configure wrong here? Is there anything else that I should look out for in the configuration to make europe-west run as fast as us-central?

like image 736
Roel Vermeulen Avatar asked Oct 26 '25 14:10

Roel Vermeulen


1 Answers

OK, so talking to Google Support, I found out that there indeed is a loading difference, but it is not due to the servers being in any way slower.

The difference came from a call to the CloudStorageTools API, namely CloudStorageTools.getImageServingUrl(). Accessing the API from Europe was ~100ms to ~200ms slower than from US servers for each call. As I was making more or less 15 calls on average, this led to a noticeable difference in loading times per page.

The solution in my case was to cache the call to CloudStorageTools.getImageServingUrl() on image creation and save the result in the database. Then on displaying the images, just load the Url from the database and avoid the call to the API each time.

Google Support confirmed the difference in the CloudStorageTools API access times between Europe and US was expected behaviour, although undocumented.

like image 154
Roel Vermeulen Avatar answered Oct 29 '25 04:10

Roel Vermeulen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!