{"action":"created","issue":{"url":"https://api.github.com/repos/mysqljs/mysql/issues/712","repository_url":"https://api.github.com/repos/mysqljs/mysql","labels_url":"https://api.github.com/repos/mysqljs/mysql/issues/712/labels{/name}","comments_url":"https://api.github.com/repos/mysqljs/mysql/issues/712/comments","events_url":"https://api.github.com/repos/mysqljs/mysql/issues/712/events","html_url":"https://github.com/mysqljs/mysql/issues/712","id":25738682,"number":712,"title":"Increasing number of connections to mysql","user":{"login":"nareshbhatia","id":1220198,"avatar_url":"https://avatars1.githubusercontent.com/u/1220198?v=4","gravatar_id":"","url":"https://api.github.com/users/nareshbhatia","html_url":"https://github.com/nareshbhatia","followers_url":"https://api.github.com/users/nareshbhatia/followers","following_url":"https://api.github.com/users/nareshbhatia/following{/other_user}","gists_url":"https://api.github.com/users/nareshbhatia/gists{/gist_id}","starred_url":"https://api.github.com/users/nareshbhatia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nareshbhatia/subscriptions","organizations_url":"https://api.github.com/users/nareshbhatia/orgs","repos_url":"https://api.github.com/users/nareshbhatia/repos","events_url":"https://api.github.com/users/nareshbhatia/events{/privacy}","received_events_url":"https://api.github.com/users/nareshbhatia/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2014-01-16T16:47:47Z","updated_at":"2018-03-17T01:00:50Z","closed_at":"2014-01-19T18:50:59Z","author_association":"NONE","body":"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:\n\n```\nER_CON_COUNT_ERROR: Too many connections\n```\n\nHow 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.\n\nHere's my node.js code:\n\n```\nvar Mysql = require('mysql');\n\nvar pool = Mysql.createPool({\n    host: 'localhost',\n    user: 'bfoms_javaee',\n    password: 'bfoms_javaee',\n    database: 'bfoms_javaee',\n    connectionLimit: 400\n});\n\nexports.findAll = function(req, res) {\n\n    pool.getConnection(function(err, connection) {\n        if (err) throw err;\n\n        connection.query('SELECT * FROM orders WHERE symbol=\"GOOG\"', function(err, rows, fields) {\n            if (err) throw err;\n\n            res.send(rows);\n        });\n\n        connection.release();\n    });\n};\n```\n"},"comment":{"url":"https://api.github.com/repos/mysqljs/mysql/issues/comments/373881730","html_url":"https://github.com/mysqljs/mysql/issues/712#issuecomment-373881730","issue_url":"https://api.github.com/repos/mysqljs/mysql/issues/712","id":373881730,"user":{"login":"mhbernheim","id":7416205,"avatar_url":"https://avatars3.githubusercontent.com/u/7416205?v=4","gravatar_id":"","url":"https://api.github.com/users/mhbernheim","html_url":"https://github.com/mhbernheim","followers_url":"https://api.github.com/users/mhbernheim/followers","following_url":"https://api.github.com/users/mhbernheim/following{/other_user}","gists_url":"https://api.github.com/users/mhbernheim/gists{/gist_id}","starred_url":"https://api.github.com/users/mhbernheim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhbernheim/subscriptions","organizations_url":"https://api.github.com/users/mhbernheim/orgs","repos_url":"https://api.github.com/users/mhbernheim/repos","events_url":"https://api.github.com/users/mhbernheim/events{/privacy}","received_events_url":"https://api.github.com/users/mhbernheim/received_events","type":"User","site_admin":false},"created_at":"2018-03-17T01:00:50Z","updated_at":"2018-03-17T01:00:50Z","author_association":"NONE","body":"question... so I also stumbled by this using connection.release(); in the wrong place... thanks for that, but for learning purposes... why is it in the wrong place? "}}
{"actor":{"display_login":"mhbernheim"}}