Friday, November 16, 2018

[google-cloud-sql-discuss] Re: Why my google cloud sql is so slow? Am I missing something important?

Did you ever figure this out? 

I am almost noticing 1 second+ queries that I would expect to run much faster.

On Sunday, September 18, 2016 at 2:50:54 PM UTC-4, Lawrence Cheuk wrote:
I love google app engine and datastore, have been using them for 3 years. Now I would like to transfer my whole web site to google app engine. Which require use of cloud sql.
I set up every thing import all datatable. Start loading a page. my site is using drupal. the query speed is just very very slow, no matter big or small query. The slow problem show very consistence result. leading a final page render of 6 seconds!!!



I run a simple test. 

load a page containing a some rows, each row contain standard data field like a description, comment field, rating field, title. etc. using google F4 app engine with db-n1-standard-4 ($0.3860/Hr) and AWS Auroa db.r3.large RDS($0.290/Hr) 

I try the first load, google cloud sql is 3000ms slower than aws rds.

and then I refresh a few times until the database ram cached the queries. 

The result are shown on the attached files. 
result is google is 14 times slower than aws rds!!!!!

I love google cloud for its simplicity, beautiful console....now my aws cloud site is ready. Before I leave google cloud sql. I would like to give a last chance here. Ask it to see if I really missed something important or, cloud sql is really slow. I saw some blog post from google saying that it is faster than aws auroa using sysbench with 1 to 500 thread. The benchmark result seems impossible to me, so here is my  guess:

Their test is running from inside the same db instance machine. so it is all about disk i/o speed. But for app engine connect with cloud sql, the bottleneck I guess is the network speed (bandwidth). Although unix socket is used, if the query speed is restricted by a 100Mbps network card, it wont be fast. And it is not about latency mentioned by google. It is not 1ms per query. For query that return larger amount of data, the query is proportionally get much more slower, sometimes it can be 1000ms. And the result is very consistently proportional to the packet size (1s latency per 100kb data not per 1 query) . So I guess it is bandwidth rather than simple latency.

Additonal info that may help find out the problem: ( help PLS!)

my app engine region is us-central1
my cloud sql also in us-central1, sub region I select Any as I don't know my app engine instance is in central1a , 1b or 1c.
my harddisk type I choose is 500GB SSD, which give the highest IOPS.
the way of connection I tried, pdo, mysqli, mysql, all show same behavior slower in a magnitude of 10X than any other modern hardware. (including my 10 years old celeron desktop pc)

I am running php55




--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/34a18f9c-678c-464b-b920-0f9206d71f61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment