Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud SQL is slow

I have a D0 size Cloud SQL instance. When I run a simple

select * from table 

which has around 500 rows, it takes on average 100 ms to execute (as reported by SQL Prompt). Whereas on my local instance of MySQL 5.5, it takes only 1 ms. My dev machine has 2.9GHz dual-core Intel Core i7 and 8GB 1600MHz memory. I've read in an FAQ that performance of db depends on the size - larger instances have more RAM and CPU.

Is this reasonable to expect performance issues resolved with larger instance size? Or am I missing something else here?

like image 577
andriys Avatar asked Sep 04 '13 15:09

andriys


People also ask

How fast is Google Cloud SQL?

Google says that after today's update, Cloud SQL will feature throughput rates that are up to seven times faster than the earlier version, and the service will be able to scale to up to 10TB of data, 15,000 IOPS, and 104GB of RAM per instance — numbers the first version couldn't reach.

Why is SQL query so slow?

SQL Server uses nested loop, hash, and merge joins. If a slow-performing query is using one join technique over another, you can try forcing a different join type. For example, if a query is using a hash join, you can force a nested loops join by using the LOOP join hint.

Is Google Cloud SQL good?

It is one of the excellent database to use. Google cloud SQL delivers high performance and scalability . Cloud service is best way to manage varieties of databases like (MYSQL, PostgreSQL, SQL server). It is very to use and easy to setup.

Does Google Cloud support SQL Server?

SQL Server running on Google Cloud works with all of your familiar tools like SSMS and Visual Studio. Connect your existing workloads to the best of what Google Cloud has to offer.


2 Answers

Here's our update in January/2019.

Using Google Cloud SQL SECOND GENERATION with a 46GB database in a 4vcpu + 15GB RAM instance, we found it can be ridiculously slow even when compared to a dev macbook pro running the default mysql install with only 125MB of memory allocated to it:

Mysql: Google Cloud SQL with 10GB RAM is 20x slower than Macbook Pro configured with 125MB ram

like image 162
sandre89 Avatar answered Sep 21 '22 20:09

sandre89


Views were the cause of poor performance. Google runs their own flavor of MySQL engine which is optimized in a way that can hurt views. If you have many joins or/and unions expect views to run slow.

However, it's been almost a year since I posted this question and things might have changed. I haven't revisited views since we moved away from using them.

like image 44
andriys Avatar answered Sep 23 '22 20:09

andriys