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
Choose a base branch
from

Conversation

davidshimjs
Copy link

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

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

@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 commented Aug 24, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants