-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
I am trying to performance tune a small sample app. I started with 100 connections and hitting the node server as fast as possible. I got a throughput of ~1200 request/second. Now I tried to increase the number of db connections to 400 (by setting the connectionLimit). However, when I do this and start hitting the server hard, I get the following error:
ER_CON_COUNT_ERROR: Too many connections
How can I increase the number of connections? I don't think this is an issue on the MySQL end because I am easily able to run the same test using a Java server on the same MySQL instance.
Here's my node.js code:
var Mysql = require('mysql');
var pool = Mysql.createPool({
host: 'localhost',
user: 'bfoms_javaee',
password: 'bfoms_javaee',
database: 'bfoms_javaee',
connectionLimit: 400
});
exports.findAll = function(req, res) {
pool.getConnection(function(err, connection) {
if (err) throw err;
connection.query('SELECT * FROM orders WHERE symbol="GOOG"', function(err, rows, fields) {
if (err) throw err;
res.send(rows);
});
connection.release();
});
};
Metadata
Metadata
Assignees
Labels
No labels