如下日志所展示,init stats自己占用了90%以上的时间,导致tidb-server现在发生重启后,很长时间才能恢复正常。
PS:有时候还会出现加载失败,出现init stats info failed
的报错,登陆查询,看起来也都正常。这个应该是加载统计信息阶段,是否可以在serve 4000端口成功后,放到后台来搞?
[2023/01/11 16:54:00.581 +08:00] [INFO] [printer.go:34] ["Welcome to TiDB."] ["Release Version"=v6.5.0] [Edition=Community] ["Git Commit Hash"=706c3fa3c526cdba5b3e9f066b1a568fb96c56e3] ["Git Branch"=heads/refs/tags/v6.5.0] ["UTC Build Time"="2022-12-27 03:50:44"] [GoVersion=go1.19.3] ["Race Enabled"=false] ["Check Table Before Drop"=false] ["TiKV Min Version"=6.2.0-alpha]
[2023/01/11 16:59:11.963 +08:00] [INFO] [domain.go:1882] ["init stats info time"] ["take time"=5m10.191840021s]
[2023/01/11 16:59:12.003 +08:00] [INFO] [server.go:262] ["server is running MySQL protocol"] [addr=0.0.0.0:4000]
[2023/01/11 16:59:12.005 +08:00] [INFO] [server.go:276] ["server is running MySQL protocol"] [socket=/tmp/tidb-4000.sock]
[2023/01/11 17:30:11.245 +08:00] [INFO] [printer.go:34] ["Welcome to TiDB."] ["Release Version"=v6.5.0] [Edition=Community] ["Git Commit Hash"=706c3fa3c526cdba5b3e9f066b1a568fb96c56e3] ["Git Branch"=heads/refs/tags/v6.5.0] ["UTC Build Time"="2022-12-27 03:50:44"] [GoVersion=go1.19.3] ["Race Enabled"=false] ["Check Table Before Drop"=false] ["TiKV Min Version"=6.2.0-alpha]
[2023/01/11 17:33:55.743 +08:00] [ERROR] [domain.go:1880] ["init stats info failed"] ["take time"=3m43.33511125s] [error="interface conversion: interface {} is nil, not *memory.bytesLimits"]
[2023/01/11 17:33:55.773 +08:00] [INFO] [server.go:262] ["server is running MySQL protocol"] [addr=0.0.0.0:4000]
[2023/01/11 17:33:55.773 +08:00] [INFO] [server.go:276] ["server is running MySQL protocol"] [socket=/tmp/tidb-4000.sock]