Benchmarks of node-mysql vs node-mysql2 drivers
Test1:
for each http request, query first 3 rows of mysql.user table and render results using jade template.
Notes: This tests column definition parser (user table has 43 columns), row parser (3x43 values) and access time to result. Also this is test of how well event loop, GC, http parser and mysql driver work together. To compare mysql overhead with http + jade rendering + data transfer, there is another endpoint that renders exactly the same rows of data from memory without fetching them from mysql server.
node http server and mysql server sit on the same machine. Load test from laptop over 1gb ethernet (wrk 3.1.1).
6 cores Intel(R) Xeon(R) CPU E5-1650 0 @ 3.20GHz, 64G RAM
Mysql server version: 5.5.40-MariaDB MariaDB Server
node 0.10.33
fedora Linux 3.17.6-200.fc20.x86_64 #1 SMP
Summary:
- node-mysql: peaks 6000 rps, first timeout errors at 110 conns, latency99 60ms at 110 conns
- node-mysql2: peak 15000 rps, first timeout errors at 150 conns, latency99 30ms at 150 conn
- memory: peak 46000 rps, no erros, latency99 20ms at 300 conns (7ms at 120 conn)
Curious, what did you use for rendering those graphs?