node-mysql2 is running slower than node-mysql, config issue?
See original GitHub issueHi, I wanted to try mysql2
as a replacement for mysql
for performance reasons. When I tried it in a production environment, I am actually seeing that mysql2
is slower, so I wonder if it’s a config issue on my end. Are there any settings I should try changing?
Using the profiler, I didn’t see anything out of the ordinary. The vast majority of time is spent in handlePacket -> TextRow -> wrap. The only other difference I notice between the two libraries is that mysql2
seems to invoke Readable.push
in a very regular frequency time-wise, whereas mysql
does it in an irregular pattern. Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Comments:26 (26 by maintainers)
Top Results From Across the Web
Why is a Mysql query execution in Node JS so much slower ...
this query returns ~25k rows (500KB in total size). When I query the above query in Node.js using the node-mysql driver, it takes...
Read more >Pool cannot detect idle connection disconnected by MySQL ...
It seems mysql2's pool implementation cannot detect this type of disconnection (ping is not sufficient). And when it happens, any queries sent ...
Read more >How to vastly improve MySQL performance in Node.JS?
The only way to free them up is to manually close the connections via the pool instance or close the pool.
Read more >Overloaded connection pool with bad MySQL driver ... - alxolr
In NodeJs event loop is getting stuck only in a couple of cases: Sync code that got into an infinite loop or some...
Read more >MySQL Logging & Debugging with Node.js - databases
This can help you track down unexpected behaviour, and debug why some of your MySQL queries are running slowly. The following examples assume...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I generated it using https://www.mockaroo.com/
I found a couple issues with it. It seems to be much slower due to
For the first one, I can fix it by caching column definition attribute.