question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using mysql.createPool(): Getting "ER_CON_COUNT_ERROR: Too many connections"

See original GitHub issue

We used to use mysql.createConnection(), but recently switched to start using connection pools (mysql.createPool()). Once we did the switch we started getting the following errors when running a load test, ER_CON_COUNT_ERROR: Too many connections.

Any idea why this could be happening? When we switched back to calling createConnection() we don’t get the error.

We had setup the pool with connectionLimit: 30. We called pool.query() instead of calling pool.getConnection() connection.query() and then connection.release() after each query. What we understood was that pool.query() does that for you, and calling getConnection explicitly was for transactions etc.

Everything else is the same.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pod4gcommented, May 30, 2017

@roshanpaiva Hi, I have just met this problem, My solution is reduce the connectionLimit Try it

0reactions
dougwilsoncommented, May 31, 2017

Glad to hear, @roshanpaiva ! That would make sense why I didn’t hear back. Sorry to bother you 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Too many connections error in node-mysql - YouTube
MySQL : ER_CON_COUNT_ERROR: Too many connections error in node- mysql [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found