-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
How to handle Sleep Connection in ShardingSphere-Proxy #24122
Comments
ShardingSphere-Proxy doesn't support closing idle connections for now. |
@TeslaCN . Thank you for answer.
If so, do you have plans to support? What can I do to add this feature? |
Hello, @Byeongcheol-Kim Thanks for your issue. It sounds reasonable, so I talked with @TeslaCN to check whether it's possible to finish this minor but interesting improvement in our next release. Later on, @TeslaCN will start out with a function design, and we hope it can catch March's release. Thanks! |
Hi. @tristaZero Thank you. I will close this issue once it is published. thank you. |
@TeslaCN If any updates, please be free to let us know, Thanks. |
I have some idea about this issue. How to configure idle timeout in databaseThe parameter corresponding to MySQL is The parameter corresponding to PostgreSQL is But ShardingSphere-Proxy doesn't maintain global variables and session variables at present. So we may consider adding the idle timeout parameter in properties. API changesAdd new prop: props:
proxy-frontend-connection-idle-timeout: 3600 Idea about implementing idle timeout in ShardingSphere-ProxyCreate a Handler for judging idle timeout and place it after In terms of connection idle detection, Netty has provided relevant implementations: How to distinguish real idle and I/O idle while executing long statementWhen executing Such as: set wait_timeout=10
select sleep(20); At the ShardingSphere-Proxy level, consider judging whether
|
@TeslaCN , @tristaZero
|
Kill connection is not supported for now. It can kill executing statements only. |
let me try it. |
Welcome @sunkai-cai |
Hi @sunkai-cai |
yes,I'am here. sorry, I am late. I'll done it in this week. |
Question
For English only, other languages will not accept.
Before asking a question, make sure you have:
Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will close it.
Hello. I am currently using ShardingSphere-Proxy as a Djnago App connected to two Mysql DBs. However, after connecting ShardingSphere-Proxy in Django, it was not closed properly, so I found that the number of connections in Sleep state in ShardingSphere-Proxy gradually increased. To solve this, I wrote a code that explicitly closes the connection in Django, but I wondered if ShardingSphere-Proxy would add a function that closes the connection after a certain amount of time, such as Mysql's wait_time. ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout
Or, I wonder if it is possible to handle Sleep Connection in ShardingSphere-Proxy.
Please let me know in the comments if there's any information I've misunderstood.
The text was updated successfully, but these errors were encountered: