App Engine fetching data from google cloud instance very slow

364 views
Skip to first unread message

Kürsat Aydinli

unread,
Nov 25, 2015, 4:50:29 PM11/25/15
to Google Cloud SQL discuss
Hi,

I have written a GWT App which visualizes moviedata (database with 80000 rows/entries) on the Web in different manners (Table, Worldmap, Piechart, Columnchart). For my local development I use Wamp Server and local MySQL database which works really fine and fast. But when I host the App to GAE (using same database which is on Google Cloud SQL) the fetching time from the database is very slow...it even seems to crash after 1 minute. After the first deployment of the App to GAE the App seems to work, but when I try to reload or filter the table view of the data, the connection to Google Cloud Sql seems to crash.

My App is authorized on Google Cloud and has access to my database on Google CLoud SQL. But After I use my App for like 1 minute the database connections seems to be interrupted.
I have gone through every possible setting opportunities on Google Developers.

Could you please give me some help or advice? If needed, I can post my App Engine Link for you to try out the App.

Thanks and Kind Regards

Razvan Musaloiu-E.

unread,
Nov 25, 2015, 4:55:48 PM11/25/15
to google-cloud...@googlegroups.com
How are you connecting to Cloud SQL from GAE? Are you using a JDBC URL that has a 'jdbc:google:mysql://' prefix?

-- Razvan ME

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/4fbb6c80-2975-46ab-a269-df95bda66928%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kürsat Aydinli

unread,
Nov 25, 2015, 5:08:09 PM11/25/15
to Google Cloud SQL discuss
This is my connection link:
url = "jdbc:google:mysql://moviedatabase-1113:moviedatabase/moviedatabase?user=root";


Am Mittwoch, 25. November 2015 22:55:48 UTC+1 schrieb Razvan Musaloiu-E.:
How are you connecting to Cloud SQL from GAE? Are you using a JDBC URL that has a 'jdbc:google:mysql://' prefix?

-- Razvan ME
On Wed, Nov 25, 2015 at 1:50 PM, Kürsat Aydinli <kuersat...@uzh.ch> wrote:
Hi,

I have written a GWT App which visualizes moviedata (database with 80000 rows/entries) on the Web in different manners (Table, Worldmap, Piechart, Columnchart). For my local development I use Wamp Server and local MySQL database which works really fine and fast. But when I host the App to GAE (using same database which is on Google Cloud SQL) the fetching time from the database is very slow...it even seems to crash after 1 minute. After the first deployment of the App to GAE the App seems to work, but when I try to reload or filter the table view of the data, the connection to Google Cloud Sql seems to crash.

My App is authorized on Google Cloud and has access to my database on Google CLoud SQL. But After I use my App for like 1 minute the database connections seems to be interrupted.
I have gone through every possible setting opportunities on Google Developers.

Could you please give me some help or advice? If needed, I can post my App Engine Link for you to try out the App.

Thanks and Kind Regards

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

Razvan Musaloiu-E.

unread,
Nov 25, 2015, 5:16:40 PM11/25/15
to google-cloud...@googlegroups.com
Can you please make sure the app is not leaking the Cloud SQL connections? Each GAE instance is not allowed to use more than 12 connections and the one I looked was already hitting that limit.

-- Razvan ME

On Wed, Nov 25, 2015 at 2:08 PM, Kürsat Aydinli <kuersat...@uzh.ch> wrote:
This is my connection link:
url = "jdbc:google:mysql://moviedatabase-1113:moviedatabase/moviedatabase?user=root";

Am Mittwoch, 25. November 2015 22:55:48 UTC+1 schrieb Razvan Musaloiu-E.:
How are you connecting to Cloud SQL from GAE? Are you using a JDBC URL that has a 'jdbc:google:mysql://' prefix?

-- Razvan ME
On Wed, Nov 25, 2015 at 1:50 PM, Kürsat Aydinli <kuersat...@uzh.ch> wrote:
Hi,

I have written a GWT App which visualizes moviedata (database with 80000 rows/entries) on the Web in different manners (Table, Worldmap, Piechart, Columnchart). For my local development I use Wamp Server and local MySQL database which works really fine and fast. But when I host the App to GAE (using same database which is on Google Cloud SQL) the fetching time from the database is very slow...it even seems to crash after 1 minute. After the first deployment of the App to GAE the App seems to work, but when I try to reload or filter the table view of the data, the connection to Google Cloud Sql seems to crash.

My App is authorized on Google Cloud and has access to my database on Google CLoud SQL. But After I use my App for like 1 minute the database connections seems to be interrupted.
I have gone through every possible setting opportunities on Google Developers.

Could you please give me some help or advice? If needed, I can post my App Engine Link for you to try out the App.

Thanks and Kind Regards

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/3dc6416f-ada2-4925-b1fc-fe12f20d0cee%40googlegroups.com.

Kürsat Aydinli

unread,
Nov 25, 2015, 5:21:01 PM11/25/15
to Google Cloud SQL discuss
How can I make sure the app is not leaking the Cloud Sql connection? Can I somehow reset my used connection? I didn´t get your answer I think


Am Mittwoch, 25. November 2015 23:16:40 UTC+1 schrieb Razvan Musaloiu-E.:
Can you please make sure the app is not leaking the Cloud SQL connections? Each GAE instance is not allowed to use more than 12 connections and the one I looked was already hitting that limit.

-- Razvan ME
On Wed, Nov 25, 2015 at 2:08 PM, Kürsat Aydinli <kuersat...@uzh.ch> wrote:
This is my connection link:
url = "jdbc:google:mysql://moviedatabase-1113:moviedatabase/moviedatabase?user=root";

Am Mittwoch, 25. November 2015 22:55:48 UTC+1 schrieb Razvan Musaloiu-E.:
How are you connecting to Cloud SQL from GAE? Are you using a JDBC URL that has a 'jdbc:google:mysql://' prefix?

-- Razvan ME
On Wed, Nov 25, 2015 at 1:50 PM, Kürsat Aydinli <kuersat...@uzh.ch> wrote:
Hi,

I have written a GWT App which visualizes moviedata (database with 80000 rows/entries) on the Web in different manners (Table, Worldmap, Piechart, Columnchart). For my local development I use Wamp Server and local MySQL database which works really fine and fast. But when I host the App to GAE (using same database which is on Google Cloud SQL) the fetching time from the database is very slow...it even seems to crash after 1 minute. After the first deployment of the App to GAE the App seems to work, but when I try to reload or filter the table view of the data, the connection to Google Cloud Sql seems to crash.

My App is authorized on Google Cloud and has access to my database on Google CLoud SQL. But After I use my App for like 1 minute the database connections seems to be interrupted.
I have gone through every possible setting opportunities on Google Developers.

Could you please give me some help or advice? If needed, I can post my App Engine Link for you to try out the App.

Thanks and Kind Regards

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

Razvan Musaloiu-E.

unread,
Nov 25, 2015, 5:23:12 PM11/25/15
to google-cloud...@googlegroups.com
An example is here:

https://cloud.google.com/appengine/docs/java/cloud-sql/

At the bottom there are some links to some more examples on GitHub.

-- Razvan ME

On Wed, Nov 25, 2015 at 2:21 PM, Kürsat Aydinli <kuersat...@uzh.ch> wrote:
How can I make sure the app is not leaking the Cloud Sql connection? Can I somehow reset my used connection? I didn´t get your answer I think

Am Mittwoch, 25. November 2015 23:16:40 UTC+1 schrieb Razvan Musaloiu-E.:
Can you please make sure the app is not leaking the Cloud SQL connections? Each GAE instance is not allowed to use more than 12 connections and the one I looked was already hitting that limit.

-- Razvan ME
On Wed, Nov 25, 2015 at 2:08 PM, Kürsat Aydinli <kuersat...@uzh.ch> wrote:
This is my connection link:
url = "jdbc:google:mysql://moviedatabase-1113:moviedatabase/moviedatabase?user=root";

Am Mittwoch, 25. November 2015 22:55:48 UTC+1 schrieb Razvan Musaloiu-E.:
How are you connecting to Cloud SQL from GAE? Are you using a JDBC URL that has a 'jdbc:google:mysql://' prefix?

-- Razvan ME
On Wed, Nov 25, 2015 at 1:50 PM, Kürsat Aydinli <kuersat...@uzh.ch> wrote:
Hi,

I have written a GWT App which visualizes moviedata (database with 80000 rows/entries) on the Web in different manners (Table, Worldmap, Piechart, Columnchart). For my local development I use Wamp Server and local MySQL database which works really fine and fast. But when I host the App to GAE (using same database which is on Google Cloud SQL) the fetching time from the database is very slow...it even seems to crash after 1 minute. After the first deployment of the App to GAE the App seems to work, but when I try to reload or filter the table view of the data, the connection to Google Cloud Sql seems to crash.

My App is authorized on Google Cloud and has access to my database on Google CLoud SQL. But After I use my App for like 1 minute the database connections seems to be interrupted.
I have gone through every possible setting opportunities on Google Developers.

Could you please give me some help or advice? If needed, I can post my App Engine Link for you to try out the App.

Thanks and Kind Regards

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6e481a4e-9e0b-4106-a1f7-e721f75ae702%40googlegroups.com.

Kürsat Aydinli

unread,
Nov 26, 2015, 9:38:20 AM11/26/15
to Google Cloud SQL discuss

I somehow can`t connect to the Google CLoud SQL Instance in the properties menu from my app. However, I get acces to my data when I deploy the first time. I have attached a screenshot of my configuration. On Cloud SQL, I use root as user and password...
No mather which combination I try to enter to the dialog box i always get an error...I also tried to enter the IPV6-Address as instance name

To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

Kürsat Aydinli

unread,
Nov 26, 2015, 9:42:37 AM11/26/15
to Google Cloud SQL discuss
The link you sent me statet to always close established connection...where exactly do I have to close established connections? After each RPC Call or after the Connection method you got my link from?


Am Mittwoch, 25. November 2015 23:23:12 UTC+1 schrieb Razvan Musaloiu-E.:
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

Kürsat Aydinli

unread,
Nov 26, 2015, 9:47:54 AM11/26/15
to Google Cloud SQL discuss
This is my method in the class which establishes a database connection to Cloud SQL. The first method is the connection establishing method and the second method is a sample method I use during my RPC calls to fetch data from the database:
public void connect() throws ClassNotFoundException {
if (SystemProperty.environment.value() == SystemProperty.Environment.Value.Production) {
Class.forName("com.mysql.jdbc.GoogleDriver");
url = "jdbc:google:mysql://moviedatabase-1113:moviedatabase/moviedatabase?user=root";
} else {
Class.forName("com.mysql.jdbc.Driver");
url = "jdbc:mysql://localhost:3306/moviedatabase-neu?user=root";

}
}


/**
* fetches data from the database depending on the SQL query. Returns an
* arraylist of movie data instances in order to visualize them in different
* manners
*/
public List<DataRow> fetchData(String query) {
String SQLquery = query;
java.sql.ResultSet result = null;
ArrayList<DataRow> datarow = new ArrayList<DataRow>();

try {
this.connect();
Connection conn = DriverManager.getConnection(this.url, "root","root");
result = conn.createStatement().executeQuery(SQLquery);
int count = 0;
while (result.next()) {
datarow.add(new DataRow());
datarow.get(count).setWiki(result.getInt("WikipediaID"));
datarow.get(count).setFreebase(result.getString("FreebaseID"));
datarow.get(count).setName(result.getString("Name"));
datarow.get(count).setYear(result.getInt("Year"));
datarow.get(count).setRevenue(result.getInt("Revenue"));
datarow.get(count).setLength(result.getDouble("Length"));
datarow.get(count).setLanguage(cleanQuery(result.getString("Language")));
datarow.get(count).setCountry(cleanQuery(result.getString("Country")));
datarow.get(count).setGenre(cleanQuery(result.getString("Genre")));
count++;
}
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
/**
* returns arraylist of moviedata
*/
return datarow;
}


Did I forget to close established connections somewhere?
Thanks and Regards

Am Mittwoch, 25. November 2015 23:23:12 UTC+1 schrieb Razvan Musaloiu-E.:
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

Kürsat Aydinli

unread,
Nov 26, 2015, 10:34:05 AM11/26/15
to Google Cloud SQL discuss
I think I figured out the problem...I always forgot to close the established connection like you said...now I closed every connection after the data fetch was successful...and now the links works fine...It`s a bit slow but at least it does not break the connection after 1 minute....thanks so much for your help
Kind Regards


Am Mittwoch, 25. November 2015 23:23:12 UTC+1 schrieb Razvan Musaloiu-E.:
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

Razvan Musaloiu-E.

unread,
Nov 26, 2015, 8:07:33 PM11/26/15
to google-cloud...@googlegroups.com
Glad to hear that things are working now. :-)

-- Razvan ME

To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/c2b8f48a-2a0a-4863-b77f-81e14919d05d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages