Generating a chunk is one of the most expensive things a Minecraft server does. Doing it while players are online means they feel every one of them. Doing it in advance means they never do.
What you are seeing
- TPS drops sharply when someone flies or rides into unexplored land.
- The lag follows the explorer around and stops when they stop.
- A new world lags for its first weeks and then settles down.
Why it happens
New terrain has to be calculated, populated with structures and written to disk, all inside the tick. A player moving quickly outruns that work and the server falls behind trying to keep up.
What to do
- Set a world border first
worldborder set 10000in the console gives a 10,000-block square. Without a border there is no edge to generate up to, and the job never ends. - Pre-generate up to the border
Use a chunk pre-generator plugin such as Chunky. It walks the area and generates it ahead of time, usually with the server empty.
- Run it when nobody is playing
Pre-generation is deliberately heavy — it is doing all that work as fast as it can. Overnight is the usual choice.
Fly to the border in creative. TPS stays near 20 the whole way, because nothing new is being made.
Pre-generated chunks take real disk space, and a large border can add several gigabytes. Check your plan's storage before generating a very large area.