Skip to content

Minecraft Threading

Cubicake edited this page Aug 14, 2026 · 2 revisions

What are threads?

In essence, a thread is something which can run code. It is linear: a thread cannot do several things at the same time. You can learn more about them here. The rest of this page assumes a basic knowledge of threads.

Minecraft server threading

There is a common misconception that Minecraft servers run on a single thread. While Minecraft has a "main" thread, several more threads are used by the server. The three main types of thread used by Minecraft servers are the main thread, Netty networking threads, and chunk worker threads.

The main thread

The main thread handles the core gameplay loop, including ticking entities and blocks, player actions, etc. When people say Minecraft is single-threaded, it is this main thread they are referring to.

Netty networking threads

The server and clients communicate by sending packets of information between to each other. Netty is a framework which provides the building-blocks for this networking in Minecraft. The Netty threads handle serialising data from the server into packet form to send to the client, and deserialising packets sent by the client to pass to the main thread for processing. Each player is assigned to a specific Netty thread, which does not change for the duration the player is connected. All packets to/from a single player are sent using that players' Netty thread.

Chunk worker threads

Chunk loading and generation can be expensive, so modern vanilla Minecraft performs some of this work on separate worker threads rather than doing everything on the main thread. These workers handle parts of the chunk generation and loading pipeline which can safely be performed in parallel. Work which needs to interact with the live world or other main-thread-only state is still passed back to the main thread.

Paper builds on this system with its own chunk scheduling and I/O infrastructure. It moves more of the chunk loading, generation, and saving pipeline away from the main thread, and better schedules this work across worker threads. This reduces the amount of time the main thread spends waiting for chunks, particularly when players are moving quickly into areas which have not yet been generated.

Other threads

The three thread categories above are the threads created by a typical Minecraft server, but they are not the only threads that are needed to run your Minecraft server. While plugins run on the main thread by default, many plugins (like RaycastedAntiESP) use their own threads to perform work off of the main thread and not hinder your servers' performance.

Additionally, the JVM (the process that runs your Minecraft server, learn more about it here) uses several more threads of its own, primarily for garbage collection and JIT compilation.

Summary

While the core gameplay loop is handled in a single thread, Minecraft uses more than just a single thread. If your server only has access to a single (hardware) thread it will be noticeably slower as that single thread will need to perform the work that would otherwise be done by several different threads.

Addendum 1: The difference between software and hardware threads

The threads discussed above are software threads, and should not be confused with the hardware threads, which represent the CPU resources available to run them. Server hosts often advertise these resources as cores, threads, or vCores, although these terms are not technically interchangeable. There does not need to be one hardware thread for every software thread.

The operating system schedules software threads onto the hardware threads available to it. If a Minecraft server has 20 software threads but only 4 hardware threads available, those 20 threads take turns running on the 4 hardware threads. Many of them will spend most of their time sleeping or waiting for work anyway, so they do not all need CPU time at once.

For this reason, seeing that your Minecraft server has dozens of threads does not mean you should rent a server with dozens of hardware threads. Minecraft’s main thread still performs most of the important gameplay work, so strong single-threaded CPU performance is generally more important than matching the server’s software thread count with an equal number of hardware threads. Extra hardware threads are still useful for networking, chunk work, garbage collection, and other background tasks, but their usefulness has diminishing returns for a single Minecraft server.

Addendum 2: How many threads should a Minecraft server have?

While this obviously varies a lot depending on many factors, I would generally recommend no fewer than two hardware threads. There is a noticeable difference between one and two threads, while the difference is much smaller when adding more threads. This is because when a server has a single thread the main thread must share with every other thread, while when there are two threads the main thread will be interrupted significantly less.

Four threads is a reasonable standard for most servers, and anything past eight threads is almost certainly pointless (barring multithreaded forks such as Folia) as your server will be bottlenecked by the main thread.

Clone this wiki locally