0

Ive created a MySQL 5.7 instance on google SQL and from the very first day, for no apparent reason, I've had 4/5 active connections at all time.

Those connections are definitely not me and, from what I understand, I am having to pay for that usage even thought it wasn't me using the SQL instance. I do have daily backups set up but they happen once a day and don't see why backup mechanism that Google provides would be connected to MySQL instance at all times.

What can be done about it or is it just part of it?

view of what I see within my control panel


Diagnostics.

I've run commands below using MySQLWorkbench.

SHOW PROCESSLIST; (I've hid two entries with my IP address)

SHOW GLOBAL STATUS LIKE 'Threads_running';

SHOW GLOBAL STATUS LIKE 'Max_used_connections';

2 Answers2

0

To help diagnose the situation, please run these:

SHOW PROCESSLIST;  -- Will show processes (including background threads)
SHOW GLOBAL STATUS LIKE 'Threads_running';  -- num procs actually running
SHOW GLOBAL STATUS LIKE 'Max_used_connections';   -- highwater mark

(I do not know which of the above maps to "Active connections"; I need to back up to what MySQL thinks in order to help.)

(It may be that Google has added code to MySQL; can't help you there.)

In any case, the mystery-5 is probably not too important.

More

Those screen shots do not show any activity.

"Sleep" connections cause very little overhead; don't worry about them. Watch (by doing SHOW PROCESSLIST repeatedly) the "Time" for them; you may find that they increase to, say, 30 and then reset to 0. That would mean that they are doing something every 30 seconds. And, since you probably missed what they did, it is something quite fast. I would guess some monitoring query -- which is beneficial to you.

Rick James
  • 2,463
  • 1
  • 6
  • 13
0

After some digging I found a describe command that states all the settings about an instance: gcloud sql instances describe {instanceName}. Here, under settings, I saw that my activation policy is set to always activationPolicy: ALWAYS, which means that my instance is always running.

From what I understood, after some further reading, is that google keeps instance alive and those active connection are tied to this.

On demand usage is not something that google has on offer - https://issuetracker.google.com/issues/69109113#comment77