The Wayback Machine - https://web.archive.org/web/20201101090536/https://github.com/mysqljs/mysql/pull/1805
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stackCycle feature for decrease useless connections #1805

Open
wants to merge 2 commits into
base: master
from

Conversation

@davidshimjs
Copy link

@davidshimjs davidshimjs commented Aug 18, 2017

If you are using a connection pool and suddenly handle more traffic than usual, the size of the connection pool increases. And the increased connections will survive because of the wait_timeout setting. (It usually set as 10-30 seconds) Keeping unnecessary connections is not good for running multiple servers.

However, this problem can not be solved because the mysql module only supports round-robin styles. So I added a pool option called stackCycle.

@Robert-lihouyi
Copy link

@Robert-lihouyi Robert-lihouyi commented Aug 24, 2017

config.mysqlConfig.options = {
host: '10.255.0.128',
user: 'linkredit_devs',
password: 'KBBSK0znnqMf7ZOv',
database: 'linkredit',
port: 3318,
connectTimeout: 1000
}
const pool = mysql.createPool(commonConfig.mysqlConfig.options);
is it correct to configure the connection poo?

@davidshimjs
Copy link
Author

@davidshimjs davidshimjs commented Aug 24, 2017

@Robert-lihouyi What's your point? If you just want to listen answer, you can check out more information https://github.com/mysqljs/mysql#pooling-connections

@Robert-lihouyi
Copy link

@Robert-lihouyi Robert-lihouyi commented Aug 24, 2017

@dougwilson dougwilson force-pushed the mysqljs:master branch 2 times, most recently from 946727b to 37fbbdd Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.