What is the recommended way to optimize MySQL connections in App Engine for PHP?

2014-07-22T12:59:53

I'm building a pretty conventional PHP/MySQL back end to a mobile app, and I've been bitten hard for not closing MySQL connections properly in the past...

If I'm using mysqli_connect() to connect my App Engine-based PHP to the Google Cloud SQL, how do I make sure that I keep the number of simultaneous connections to my Cloud SQL instance at a minimum if user sessions could be quite long?

I've read that PHP 5.3+ supports persistent connections with mysqli_connect as long as you prepend the hostname with "p:" but Cloud SQL doesn't take any hostname at all when connecting from App Engine...

Copyright License:
Author:「Amos」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/24879247/what-is-the-recommended-way-to-optimize-mysql-connections-in-app-engine-for-php

About “What is the recommended way to optimize MySQL connections in App Engine for PHP?” questions

I'm building a pretty conventional PHP/MySQL back end to a mobile app, and I've been bitten hard for not closing MySQL connections properly in the past... If I'm using mysqli_connect() to connect ...
We are trying to write a web backend using google app engine. We have several different pages but they have a lot of stuff in common. So far I've gotten our cost per average user per month down to
I am currently accessing a SOAP Web Service through a PHP script using SoapClient. My script calls multiple subscripts (~30 a second) that each send a request and then pushes the response to a MySQL
I am running a MySQL DB server. During load test, with thousands of connections, MySQL queries are taking time in minutes. What can I do to optimize this situation? Here is the brief description o...
I am trying to set up multiple MySQL connections on my Laravel 6.2 web app deployed with Google App Engine. Everything worked when I had a single MySQL databse (stored on Cloud SQL) but I can't ge...
i am completely new to Google app engine. Im trying to host my wordpress blog using app engine. I tried some simple PHP scripts with app engine and everything goes well. But when i tried to load
i have a php site in index file include connect to db function : function connect(){ mysql_connect("localhost", "user", "pass") or die(mysql_error()); mysql_select_db("database"); }
I am moving from PHP/MySQL to Google App Engine and using JDO as interface with the datastore. What's the recommended way of migrating a Modified Preorder Tree Traversal (MPTT) enabled table to a JDO
I am planning to create a facebook canvas app using php sdk. Google app engine providing free account so I am planning to do it. But still there is a problem , right now google app engine support...
I have a VPS running CentOs 6.5, PHP-FPM, Mysql database and Nginx server. I installed and used mysql by default, which I can see now that it is using InnoDB as the default engine. So, after real...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.