mysql_real_query is blocking #59

erikdubbelboer opened this Issue Mar 2, 2012 · 0 comments


None yet
1 participant


It seems you are using mysql_real_query() which is a blocking call. Nodejs only runs a maximum of 4 threads so running 4 slow queries using your library will block everything else.

You can try this by running 4 SELECT SLEEP(10) queries and then doing some fast query. The fast query will only run after the 4 slow queries are done. Example code here:

(The example code actually causes a Segmentation fault but if you want I can create another ticket for that)

An example on how to do async queries can be found here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment