I have a Google App Engine app that uses a Google Cloud SQL instance for storing data. I need my instance to be able to serve hundreds of clients at a time, via restful cal
I read from the documentation and noticed there's a 12 connection / instance limit:
Look for "Each App Engine instance cannot have more than 12 concurrent connections to a Google Cloud SQL instance." in https://developers.google.com/appengine/docs/python/cloud-sql/
Short answer: Your queries are probably too slow and the mysql server doesn't have enough threads to process all of the requests you are trying to send it.
Long Answer:
As background, Cloud SQL has two limits that are relevant here:
It doesn't sound like the connection limit is affecting you, but I wanted to mention it just in case.
When it comes to Concurrent Requests, increasing the limit might help, but it usually makes the problem worse. There are two cases we've seen in the past:
You should use EXPLAIN and SHOW ENGINE INNODB STATUS to see which of the two problems is going on.
Of course, it is also possible that you are just driving a ton of traffic at your instance and there just aren't enough threads. In that case, you'll probably be maxing out the cpu for the instance anyway, so adding more threads won't help.