TransWikia.com

Can I get a Linux Minecraft server to use multithreading?

Arqade Asked by cody Zavodsky on July 19, 2021

I am using a raspberry pi 4B to run a Minecraft server. It has a quad-core CPU at 1.5GHZ. I am also using spigot 1.16.5. Is it possible to make Minecraft use all CPU cores instead of just one? I am also able to use Linux commands, as I am running the raspberry pi OS. This would be good to have, because I could build a supercomputer with a raspberry pi to get 8 or even 12 cores.

One Answer

To put it simply, no, you cannot do so without rewriting most of the game.

This means if you want better server performance, get the best single-thread CPU you can buy. The good news is that these days, ARM platforms have nearly caught up. Your raspberry-pi is at about 1/8th of the speed of the fastest processors available (writing June 2021), so you could do a lot better by running instead on something like a recent laptop/low-power processor. When it comes to standalone products, something like a PN51 or mac mini (similar power requirements, available as a standalone NUC). A cheap PC2 is another option. Or you could rent a 1-core VPS. Of course, once you start wanting to run many servers, then server CPU machines will work best.

In fact, the minecraft devs did just that for this, and other reasons, and made Bedrock Edition, which is natively written. This means: Instead of using intermediate bytecode, directly compiled to x86(-64) or ARM assembly.

Clustering1, on the other hand is not supported (by either game) and I don't think it's very likely that it ever will be. While theoretically possible, this too means essentially writing your own server code from the ground up.

1: By this I mean a server that runs on multiple machines, communicating to provide redundancy and share workload in-between them, using load-balancing, fencing, and other advanced techniques.

2: This won't be as power-efficient for 24/7 operation; as PCs nowadays have many cores but pretty poor single-core power efficiency. While e.g. a 16-core CPU won't use 100% power when only one core is loaded, the real figure is going to be closer to 30% than the ~7% you'd expect. You could however optimize this: set lower maximum turbo speeds for your CPU. For example, looking at this article, it seems that you could get only 1/3rd the power draw by lowering the turbo frequency from 5 GHz to arond 3.5 GHz. If you're willing to tweak your computer a bit it's quite easily possible to get massive efficiency benefits by underclocking it by about 20-30%.

Answered by aphid on July 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP