jmac11 / googlecloudsql

Automatically exported from code.google.com/p/googlecloudsql
0 stars 0 forks source link

PHP Warning: mysqli_connect(): (08004/1040): Too many connections #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Have a database with lots of rows
2.Modify an index
3.Try to connect on the database while it's working on the indexes

Hello,

I do not think it is a classic problem, since I searched a lot before posting 
this here. I've been encountering the "Too many connections" issue a lot of 
time, and it is really urgent that I solve the problem now.
I successfully saw this problem in live twice, and the only clue I found was 
that the processlist was very huge.
(I'm working with a huge database, with D8, so I assume 1000 connections.)

The first clue is that Google Cloud SQL is able to thread its processes, and 
every thread takes a connection. If I do a big request, Google Cloud SQL will 
thread it and I will not be able to work on it anymore. Since I'm working with 
the database 24/24 7/7, it is very important for me that I do not encounter 
this issue.

The solution would be to limit the number of thread Google Cloud SQL can split. 
Can you help me asap please?

Thanks.

Original issue reported on code.google.com by carglass...@gmail.com on 8 Jul 2014 at 10:37

GoogleCodeExporter commented 9 years ago
1. Try to increase the value of the connections in the main config file (e.g., 
/etc/my.cnf) using this syntax:

[mysqld] 
set-variable=max_connections=250 
change 250 to some other number you desire.

** That should be placed in the [mysqld] section. Otherwise MySQL will ignore 
it.

2. You can choose and select the appropriate package that allows you to set the 
maximum concurrent connections according to your needs and hence be able to 
accomplish the MySQL jobs you need to run. More information can be found here: 
https://cloud.google.com/sql/pricing

3. Technical support for individual applications is not provided via the issue 
tracker. Going forward, if you need individual help with your project, please 
visit https://cloud.google.com/support/ to choose options which will meet your 
needs.

Best regards,

Original comment by mo...@google.com on 18 Mar 2015 at 4:39