shebaoting can you share more details?
Does MySQL throw an error? Or you mean the migrations time out on the web?
If it's a timeout issue, I don't think there's much we can do. You should be able to solve the issue by allocating more resources to Flarum, and/or running migrations from the command line.
If the problem is only during migrations and not normal usage, I'm not sure if we should call this performance. We care a great deal about performance for forum visitors. Migrations however don't need to be performant since they happen only once and the administrator has the flexibility of deciding when, but we definitely want to make them as reliable as possible even if they take a long time on large forums.