War story of the day: do not use — or be very careful when using — the max_connections beta database flag on CloudSQL... because it has many bugs.
I was hit by this today: we set the max_connections flag to 8000 on a primary server a few days ago, we had a failover last night, and the flag was not set on the replica (bug #1).
Update 2019-05-03: there is another bug (bug #1.5). If you set the