-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
domain: load stats table asynchronously #5188
Conversation
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
@lamxTyler CI failed. |
@shenli It is not caused by this PR, @tiancaiamao is looking at it. |
@lamxTyler @shenli Before this PR, tidb-server on our cluster takes 8 minutes to start before After this PR, tidb-server starts very quickly and ready for accepting queries, If that's the case then I would prefer that tidb-server load stats fully before accepting queries. Is it feasible that loading the stats on demand? |
@darren How many tables do you have? Could you provide us some of you schema and sql? We could check why them run slow with default statistic info. |
We are still bulk loading data in the cluster and due to rotational disks on our TiKV servers, thus I expect that it will load slow. I think it's normal. Here's a debug log of tidb-server start before this PR: |
@lamxTyler |
@lamxTyler Could we make it another 10x faster? |
A native improvement: load stats_meta/stats_histograms/stats_buckets parallelly. |
@lamxTyler Could you log some info about when stats loading starts and finishes? for now I have to set log level to debug and do some estimates by hand. I think the print out some info level log about stats loading status is important for admins. |
@darren Yes, I will do it. |
@lamxTyler @shenli Good job! It's really faster now: 2017/12/01 10:21:55.491 domain.go:613: [info] [stats] init stats info takes 7.019830276s |
load stats table asynchronously (#5188)
We do not have to wait all stats table loaded into memory when starts TiDB server.