Ryan Rogers
Ryan Rogers

Reputation: 21

GAE slowness with external MySQL DB

I have a Java GAE hobby project utilizing a MySQL DB. I have been using Google's own CloudSQL, but am exploring switching to a cheaper, external MySQL host (Hostinger) for cost reasons.

When I am running the application locally, though still against the new remote MySQL host, the application runs quickly and responsively, just as it did with Google's CloudSQL (both locally and deployed). However whenever I deploy it to the GAE servers, it runs incredibly slow, and from looking at the logs its clear the time is in the DB requests (just reads/selects - no writes at this time).

Is there something inherently slow about GAE applications connecting to external/non-CloudSQL DBs? Anything that can be tweaked to improve performance?

Upvotes: 0

Views: 43

Answers (1)

Soni Sol
Soni Sol

Reputation: 2612

As far as I know there is nothing inherently slow when connecting to external services.

What can be generating this long time for connections from GAE to Hostinger is the distance between both datacenters. You can try deploying the GAE in a region closer to the hostinger datacenter and the time shall get reduced.

As a work around for this you can deploy the database in cloudSQL in a micro instance in one of the regions that apply for always free tier this way you can get the short time of response and it will still be cheap.

Upvotes: 1

Related Questions