PaperMC /Folia

Fork of Paper which adds regionised multithreading to the dedicated server.

★ 4,744⑂ 650👁 94⑃ 124● 391▤ 0
ShellGPL-3.0Created 2023-02-20
TA的项目
4,744
stars
650
forks
94
watchers
124
prs
391
issues
0
releases

README

===========


    
    
    Fork of Paper which adds regionised multithreading to the dedicated server.


 Overview

Folia groups nearby loaded chunks to form an "independent region."
See the PaperMC documentation for exact details on how Folia
will group nearby chunks.
Each independent region has its own tick loop, which is ticked at the
regular Minecraft tickrate (20TPS). The tick loops are executed
on a thread pool in parallel. There is no main thread anymore, 
as each region effectively has its own "main thread" that executes
the entire tick loop.

For a server with many spread out players, Folia will create many
spread out regions and tick them all in parallel on a configurable sized
threadpool. Thus, Folia should scale well for servers like this.

Folia is also its own project, this will not be merged into Paper
for the foreseeable future. 

A more detailed but abstract overview: Project overview.

 FAQ

 What server types can benefit from Folia?
Server types that naturally spread players out, 
like skyblock or SMP, will benefit the most from Folia. The server
should have a sizeable player count, too.

 What hardware will Folia run best on?
Ideally, at least 16 _cores_ (not threads).

 How to best configure Folia?
First, it is recommended that the world is pre-generated so that the number
of chunk system worker threads required is reduced greatly.

The following is a _very rough_ estimation based off of the testing
done before Folia was released on the test server we ran that
had ~330 players peak. So, it is not exact and will require further tuning - 
just take it as a starting point.

The total number of cores on the machine available should be 
taken into account. Then, allocate threads for: 
- netty IO :~4 per 200-300 players
- chunk system io threads: ~3 per 200-300 players
- chunk system workers if pre-generated, ~2 per 200-300 players
- There is no best guess for chunk system workers if not pre-generated, as
  on the test server we ran we gave 16 threads but chunk generation was still
  slow at ~300 players.
- GC Settings: ???? But, GC settings _do_ allocate concurrent threads, and you need
  to know exactly how many. This is typically through the -XX:ConcGCThreads=n flag. Do not
  confuse this flag with -XX:ParallelGCThreads=n, as parallel GC threads only run when
  the application is paused by GC and as such should not be taken into account.

After all of that allocation, the remaining cores on the system until 80%
allocation (total threads allocated 
    papermc
    https://repo.papermc.io/repository/maven-public/


 Artifact Information:
xml

    dev.folia
    folia-api
    26.3.build,)
    provided

 


 License
The PATCHES-LICENSE file describes the license for api & server patches,
found in ./patches and its subdirectories except when noted otherwise.

The fork is based off of PaperMC's fork example found [here.
As such, it contains modifications to it in this project, please see the repository for license information
of modif

Top issues

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON