Ajustes de Desempenho

O Sponge fornece várias opções de melhoria e ajuste do desempenho para ajudar-te a executar um servidor sem lag, mesmo sob carga pesada.

Nota

Apesar de tentarmos melhorar o desempenho de todos os servidores, os ganhos de desempenho dependem da tua máquina. Corre alguns testes para garantir configuraste o servidor Sponge de modo a tirares o proveito máximo!

Raio de Ativação de Entidades

This setting will alter the loading behaviour of entities around players. Lowering the value will only load close entities, while raising it will also load entities that are far away from the player. Lower this to improve your servers performance, especially with high entity and player counts.

Dica

É possível discriminar o raio de ativação por tipo de mob. Podes definir auto-populate para true e o Sponge adicionará todos os mobs disponíveis à lista do raio de ativação. Recomenda-se que desatives isto assim que a lista estiver cheia. Se adicionares novos mobs ao jogo, repete simplesmente este procedimento, e os novos mobs serão adicionados à lista abaixo.

entity-activation-range {
      # If enabled, newly discovered entities will be added to this config with
      # a default value.
      auto-populate=false

      # Default activation ranges used for all entities unless overidden.
      defaults {
          ambient=32
          aquatic=32
          creature=32
          misc=16
          monster=32
      }

Cache dos Donos de Entidades Domesticáveis

Esta configuração irá armazenar em cache os UUIDs dos proprietários de entidades domesticáveis para evitar pedidos constantes ao data watcher.

optimizations {
    # Caches tameable entities owners to avoid constant lookups against data watchers. If mods cause issue, disable.
    cache-tameable-owners=true
    }

Drops Pre Merge

Esta configuração vai pré-processar e potencialmente fundir itens dropados para evitar o spawn de entidades adicionais, só para serem imediatamente fundidas.

optimizations {
    # If enabled, block item drops are pre-processed to avoid
    # having to spawn extra entities that will be merged post spawning.
    # Usually, Sponge is smart enough to determine when to attempt an item pre-merge
    # and when not to, however, in certain cases, some mods rely on items not being
    # pre-merged and actually spawned, in which case, the items will flow right through
    # without being merged.
    drops-pre-merge=true
    }

Lighting Patch to Ignore Unloaded Chunks

Enabling this setting avoids loading lighting data from not yet generated chunks. This reduces disk access and chunk generation and thus improves performances while applying light levels to blocks.

optimizations {
      # This prevents chunks being loaded for getting light values at specific
      # block positions. May have side effects.
      ignore-unloaded-chunks-on-get-light=true
      }

Cache Chunk Lookups

This setting enables Sponge’s internal chunk caching to improve the server’s performance. It uses a small, additional amount of memory for caching purposes. If you run out of memory, try to disable it.

optimizations {
      # Caches chunks internally for faster returns when querying at various
      # positions
      chunk-map-caching=true
      }

Inline Block Position Checks

This setting inlines the check for if a block position is valid in a world.

optimizations{
      # Inlines a simple check for whether a BlockPosition is valid
      # in a world. By patching the check, the JVM can optimize the
      # method further while reducing the number of operations performed
      # for such a simple check. This may however break mods that alter
      # world heights and can thus be disabled in those cases.
      inline-block-position-checks=true
      }

Ajuste da Frequência de Auto-Save

O Minecraft Vanilla escreve em disco todas as chunks a cada 900 ticks (45 segundos). Se desejas aumentar ou diminuir este intervalo, podes mudá-lo no ficheiro global.conf do servidor:

world {
      # The auto-save tick interval used when saving global player data.
      # Set to 0 to disable. (Default: 900) Note: 20 ticks is equivalent to 1 second.
      auto-player-save-interval=900

      # The auto-save tick interval used to save all loaded chunks in a world.
      # Set to 0 to disable. (Default: 900) Note: 20 ticks is equivalent to 1 second.
      auto-save-interval=900
      }

Reduzir este intervalo (aumentar a frequência) aumenta a carga para a CPU e para o disco do servidor, mas minimiza a perda de dados que pode ocorrer se o servidor encravar, ou a luz for abaixo. Por outro lado, aumentar este intervalo reduz a carga no hardware, mas à custa do aumento da quantidade de dados do servidor que podem ser perdidos caso este falhe.