GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
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: https://gist.github.com/1957486
(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: http://jan.kneschke.de/2008/9/9/async-mysql-queries-with-c-api/