ResourceProfile 5.47.0
How the server trades memory and CPU for smoothness (performance-profile in server.properties).
Both profiles play exactly the same: same gameplay, mobs, terrain and view distance. They only differ in how much the server keeps in memory or prepares ahead of time:
- PERFORMANCE (default) keeps chunks, workers and buffers around so that nothing has to be redone, and the main thread is rarely interrupted.
- ECONOMY gives memory back sooner and keeps fewer helpers running, at the cost of a little more CPU (redoing things) and latency (new chunks generated by fewer workers, short write stalls during bursts of chunk saves).
The values here are defaults: a setting the owner changed in pocketmine.yml wins (see resolveInt()).
Cases
ECONOMY
case ECONOMY = "economy"PERFORMANCE
case PERFORMANCE = "performance"Methods
fromString()
public static function fromString(string $value) : ?selfParses a performance-profile value: the profile names and their Spanish aliases (rendimiento, ahorro), any case. Returns null for anything else.
getAsyncWorkerIdleTimeout()
public function getAsyncWorkerIdleTimeout() : intmemory.async-worker-idle-timeout: seconds without tasks after which an async worker is shut down.
getAutoAsyncWorkerCount()
public function getAutoAsyncWorkerCount(int $usableCores) : intNumber of async workers of settings.async-workers "auto" for this many usable cores: cores - 2, at least 2 (one worker would run generation, lighting and chunk sending one after another), at most getMaxAutoAsyncWorkers().
getChunkGenerationWorkers()
public function getChunkGenerationWorkers() : intchunk-generation.max-workers: async workers that generate chunks, each holding its own copy of the vanilla generator (~130 MB). Fewer means chunks far from the players arrive later, not different chunks.
getChunkUnloadDelay()
public function getChunkUnloadDelay() : intSeconds a chunk nobody uses stays loaded before it is unloaded (a player coming back finds it loaded and the server does not read it from disk again).
getLevelDBWriteBufferSize()
public function getLevelDBWriteBufferSize() : intLevelDB memtable size of each world, in bytes. A bigger one means fewer level-0 tables and no write throttling during bursts of chunk saves; it costs up to this much memory per world (twice while a full one is written).
getMaxAutoAsyncWorkers()
public function getMaxAutoAsyncWorkers() : intUpper bound of settings.async-workers "auto" (still at most the usable cores - 2, at least 2).
getVanillagenGoGc()
public function getVanillagenGoGc() : ?intGOGC of the vanillagen helper process (Go's default is 100: the heap may grow to twice the live data before a collection), or null to leave it to Go. A GOGC the owner set in the environment is always kept.
