What is Folia?
If you are active on the Discord or have been hanging around on the server recently then you may have heard me (penguin) promising to resolve all server perfromance issues by changing the server software to Folia. Folia is a fork of the popular Minecraft server software Paper, currently the most widely used CraftBukkit-based server.
Purity’s Server Software
For the last couple years, we have run Purpur on our server, a seperate fork of Paper. We used this fork in particular as it has a large degree of customisability which we used to limit villager AI to improve performance. Purpur also was the first Paper fork to introduce configurable projectile saving limitations (preventing the server from crashing due to snowballs or wither skulls) as well as seperate feature seeds for dungeons and end spikes, which helps prevent terrain seed cracking. These important features have since been included in Paper which now generates a completely unique seed for every feature in a particular world.
However, when running Purpur, the server had intermittent performance issues that could not be identified as entity or chunk related from Timings/Spark reports. This was eventually attributed to the large featureset of Purpur resulting in some unnecessary logic being checked, even though the vast majority of the features were disabled in the config. While this is not a particularly satisfying or complete explanation, it was proven to be largely true when we switched to a custom fork of Purpur. This fork included a hand-picked selection of Purpur’s patches, only the ones needed to help with performance and seed cracking on Purity, and when we first switched to it for 1.16 there was a marked improvement in server stability and high playercounts (70-80).
In general, a major limitation for larger single-instance Minecraft servers like Purity Vanilla is there is a limit to the number of entities, blocks and players that can be updated by a single server each tick, when this limit is exceeded the server runs slower than it should with less than 20 ticks per second (TPS). This is why networks such as Hypixel use thousands of smaller instance servers to be able to accomodate tens of thousands of concurrent players - they obviously could not achieve this using just one server. You can get more information about the reasons for server lag from this (fairly outdated) post.
What does Folia do?
Folia allows one Minecraft server (a single instance) to hold many more players than previously possible by breaking up each world into many groups of adjacent chunks which can each be ticked in parallel. See the Folia docs for some details about the implementation. This allows our primary server hardware, which only runs the main Purity Vanilla server and a Velocity proxy, to be able to handle more players by distributing the load more evenly across its many CPU threads. This is untested for Purity as of yet, although we have been running a small scale test of Folia for many months to test stability, we are yet to test the server with the same load from all of the players, farms and entities we see on the main map.
Changes to the API when compared to Paper mean that most plugins need some changes to work on Folia, while some may need to be significantly reworked. This is the case for most of our plugins, although our custom plugins could be easily used, we are reliant on the developers of larger plugins like EssentialsX updating their own plugins. Fortunately, many plugins already support Folia with more actively developing for it. A convient list for reference of popular plugins that support Folia can be found here.
Plugin Support
As we already have a small test server running the latest version of Folia, the only thing preventing us from switching the main server to it is the lack of plugin support. This, combined with some of our plugins like ChatManager being poorly supported at the moment, has prompted the development of a new set of custom plugins for Purity Vanilla which will replace the majority of the plugins. While features will mostly be the same for players, this means it will be easier to customise the server further in future and will help with implementing new cosmetic perks for example.
These plugins are very early on in development, so no precise ETA can be given. Hopefully most of the functionality of the main server will be re-implemented within a couple of months (please consider Purity Time™️). Further development updates will be posted to this blog, along with the GitHub repositories for any open source elements which will allow for our players to see the progress and potentially contribute to the server.
When will we update?
With the update to Folia dependant entirely on me developing these new plugins, the timeline for the update may change depending on the time I have available. That being said, I’m intending on having the plugins running on the test server as soon as possible, with the update for the main server coming before December. I will post any major changes to this timeline on Discord and give more detail on this site.
Thanks for your patience with any server stability or TPS issues in the meantime.