CPU control

107 views
Skip to first unread message

Anton Astashov

unread,
Sep 4, 2015, 7:02:41 PM9/4/15
to Google Cloud SQL discuss
Hi!

I started to use Google Cloud SQL, and noticed that it's pretty slow on my database. I have 25GB database, most of it is just one table - about 100 million records.
It takes ~40ms in average to insert a record into that table (though on my Macbook Pro 2013 it takes ~0.2ms). The tier almost doesn't affect the insertion times (after D8 the difference is neglectable).

What CPU do these instances have? Is there any way to use more powerful instances? It seems like I only can choose RAM there...

Thanks!

paynen

unread,
Sep 8, 2015, 1:08:48 PM9/8/15
to Google Cloud SQL discuss
Hey Anton,

I believe that the RAM changes between instance-tiers should only help the query up to a certain point. After that, the main optimization is CPU, which doesn't appear to be different between the tiers. I have to ask to sanity-check, and it seems as though you are reporting the actual DB query time, but is ~40ms including network transfer? It seems not, but just worth asking. 

You could also create a MySQL server box using Compute Engine, selecting a highcpu instance to see a faster query. I think there'd be no harm in making a Cloud Platform Public Issue Tracker feature request for Cloud SQL instance tiers to either allow increased CPU or at least specify CPU in the docs.

Best wishes,

Nick

Robert D

unread,
Sep 8, 2015, 1:09:02 PM9/8/15
to Google Cloud SQL discuss
I also think Google Cloud SQL needs faster INSERT performance.


On Friday, September 4, 2015 at 7:02:41 PM UTC-4, Anton Astashov wrote:

David Newgas

unread,
Sep 9, 2015, 1:52:12 PM9/9/15
to Google Cloud SQL discuss, rober...@parasql.com, anton.a...@gmail.com
Hi all,

As you increase the Cloud SQL tier both available RAM and CPU increase. You can think of tier as an abstract measure of processing power. The CPU power cannot be easily mapped to physical cores because of the underlying architecture. However, higher tiers correspond to greater CPU capability. This is documented: "Each instance tier comes with the RAM shown above, along with an appropriate amount of CPU"


For performance issues there are a few things you might like to investigate:
  • Set your instance to "asynchronous mode". This has higher write performance for many workloads.
  • Measure your network latency, for example by timing a "SELECT 1;" on a warm instance. 40ms might simply be the time of a network round trip from you to the Cloud SQL instance. If it takes 40ms to cross the network then even instant insert will appear to take 40ms.
  • If you are loading data in bulk, you might find a speed advantage using our Import feature.
  • There are some non-Cloud SQL specific issues that you can find in MySQL and InnoDB documentation. For example a large number of indexes will slow down inserts.
Yours,
David


--
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-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/dd455cfb-11a6-4c00-84f2-735ae3f9a99f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages