-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
gh-ost create too many sessions when server response slowly #859
Comments
@sephiroth17lh in #931 Can you please test with the |
Sorry for checking email not in time. I will test master branch in this weekend. |
Hi. I tested master branch with 150 gh-ost instances started at the same time. The number of connections created by gh-ost is under control. However, I found another problem, some sessions are blocked in "drop /* gh-ost */ table if exists the sessions on table "t_51" as following: |
We discourage multiple parallel |
@sephiroth17lh thank you for confirming that fix! I agree with @shlomi-noach that ghost is designed for one execution at a time Closing this issue as solved. Feel free to start a new issue about this new finding |
Summary
When I run lots of gh-ost instances(100) on a server(6c12t, 32GB), I found that the server was run out of resources(max-open-files). And then, I checked the sessions in mysqld and I found
Then, I used another sql "select info, count(*) from information_schema.processlist where state='statistics' and info like '%_ghc%' group by info". I found that some gh-ost created hundreds of session.
Code view
I checked the source code and found that the function
collectReplicationLag
maybe the reasonThe golang code of gh-ost as bellow. It use
go collectFunc()
continuly create new session.possible fix
Normally, if the server response slowly, it's means that the server should not apply online-ddl. But, if the server is suddenly on heavy pressure, gh-ost should reduce the queries on server rather than continuely create session uninterruptedly
The text was updated successfully, but these errors were encountered: