App Engine php PDO to cloud SQL slow connexion

17 views
Skip to first unread message

Thierry L

unread,
Nov 16, 2018, 11:53:59 AM11/16/18
to Google Cloud SQL discuss
Hi,

I'm trying to deploy a PHP55 application to GAE (standard instances) with cloud SQL connexion. 

I'm using unix_socket DSN connexion as shown in documentation, but the connexion time to cloud sql instance is very very slow (it can take up to 200ms sometimes), and have a serious impact in application response time (it should answer in 50ms, but actually have an 150ms average response time) :
"timer (seconds)": {
            "begin": 0,
            "app": 0.043889999389648,
            "pdoinit": 0.000070095062255859,
            "pdook": 0.20270991325378,
            "pdoutf8": 0.037790060043335,
            "controller": 0.062999963760376,
            "preparequery": 0.015130043029785,
            "executequery": 0.0024099349975586,
            "return": 0.0051000118255615,
            "returnok": 0.00011014938354492
        }

My application & Cloud SQL instance is on the same location id. So no problem here.

Got another app accessing cloud SQL from compute engine in same region, without any problem.

Maybe there is another connexion method i did not see in documentation ? I saw lot of people having problem like this. Maybe app engine is not the right solution ?

thanks a lot for your help !

Yasser Karout (Cloud Platform Support)

unread,
Nov 19, 2018, 1:14:01 PM11/19/18
to Google Cloud SQL discuss
Hello,

The recommended way to connect to your Cloud SQL instance using PHP is highlighted in the doc.

I suggest to go through this doc on Cloud SQL performance as a check list to eliminate causes of latency if you are experiencing issues with querying as well.

If you still could not determine the cause, I recommend that you open a new issue on the Issue Tracker website. We might be able to check if there is an internal issue with Cloud SQL.
Reply all
Reply to author
Forward
0 new messages