set timeout for a mysql query in node js

2,126 views
Skip to first unread message

Juilee Chitre

unread,
Aug 13, 2013, 4:58:03 PM8/13/13
to nod...@googlegroups.com
Hello,
I am referring to this post on stackoverflow. 
http://stackoverflow.com/questions/14406488/node-js-mysql-query-timeout

I am using node for server-side scripting and my web application is connected to a MySQL database. The database has tables having around 60 million rows. I have the need to query the database and retrieve the response and display on my web-page. But, since the database takes around a few minutes to process a query, node js renders the page before the data is retrieved.

Is there any way to set up timeout for a mysql query in node js?

Thank you.

Regards,
Juilee

Chris Wakare

unread,
Aug 14, 2013, 1:48:29 AM8/14/13
to nod...@googlegroups.com
Hi Juilee,

You can override the default connection timeout http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html  This however should be a temporary fix/alternative. Do consider  sharding on a mysql cluster ( http://www.mysql.com/products/cluster/scalability.html)  

Thanks,
Chris
Reply all
Reply to author
Forward
0 new messages