# Server Optimization

{% hint style="info" %}
As a note, most of these options are about Paper and only Paper. We highly recommend using Paper on your server.
{% endhint %}

## **Introduction** <a href="#jafzocb08new" id="jafzocb08new"></a>

Hello! We're going to be modifying some files on your server to get it up to 100% and get the most out of it. We can mainly make these modifications using Paper. Make sure you have that version, as it already improves performance!

We will be indicating in which file you have to modify and in which linear you should change the value.

### **File Modifications** <a href="#ux507sauy1zk" id="ux507sauy1zk"></a>

<div align="left"><figure><img src="/files/emvVY5hwfXHF2y9EzOI7" alt=""><figcaption></figcaption></figure></div>

Start by going to your server and selecting Files. We'll be editing the files here.

* **server.properties**

```properties
view-distance=4
network-compression-threshold=512
simulation-distance=4
```

* **bukkit.yml**

```yaml
chunk-gc.period-in-ticks=400
spawn-limits:
monsters: 20
animals: 5
water-animals: 2
water-ambient: 2
water-underground-creature: 3
axolotls: 3
ambient: 1
```

* **spigot.yml**

```yaml
save-user-cache-on-stop-only=true
mob-spawn-range=3
tick-inactive-villagers=false
nerf-spawner-mobs=true
arrow-despawn-rate=300
merge-radius:
item: 4.0
exp: 6.0
entity-activation-range:
animals: 14
monsters: 22
misc: 8
raiders: 44
water: 14
villagers: 24
flying-monsters: 32
entity-tracking-range:
players: 48
animals: 48
monsters: 48
misc: 32
other: 64
max-tick-time:
tile: 1000
entity: 1000
```

* **paper.yml**

\*\* Remember that to have these options you must have a PAPER version.

```yaml
max-auto-save-chunks-per-tick=6
optimize-explosions=true
mob-spawner-tick-rate=2
disable-chest-cat-detection=true
container-update-tick-rate=3
max-entity-collisions=2
grass-spread-tick-rate=4
non-player-arrow-despawn-rate=60
creative-arrow-despawn-rate=60
prevent-moving-into-unloaded-chunks=true
use-faster-eigencraft-redstone=true
armor-stands-tick=false
per-player-mob-spawns?true
alt-item-despawn-rate=true

    despawn-ranges:
      soft: 28
      hard: 96
#      ** Repetir estas opciones en todos los soft y hard. **
    hopper:
      disable-move-event: true
```

## **Pre-Loading Chunks** <a href="#yc6a8y1qeoez" id="yc6a8y1qeoez"></a>

Now on the other hand, in addition to all these configurations, something that will also help us a lot is having the chunks already preloaded.

When a player is loading terrain, they'll be loading chunks, and this is a huge resource drain, especially in high-level builds. Imagine all the players scattered around the map loading different terrain. It's a huge burden, which is generally felt in TPS.

For that, we have our savior plugin,[ **Chunky**](https://www.spigotmc.org/resources/chunky.81534/) **.** It will load chunks and pre-load them, so when a player passes through that pre-loaded terrain, they won't use the same amount of resources.

* [**For this, we will download the Chunky**](https://www.spigotmc.org/resources/chunky.81534/) plugin (It should be noted that it works from 1.13.X to 1.18.X, in lower versions there is not much expense in loading so it is not necessary.)

{% file src="/files/F2B3T2dM58y6pYyePt67" %}
Quick plugin installation
{% endfile %}

* Once installed and running, we'll begin the loading process. (Keep in mind that the server will be under constant load during this process, so it's not recommended to do this and play at the same time. It's recommended to pre-load it overnight or when there are no players.)

1. First, we will select the world we are going to pre-load, with the command:

```
/chunky world [World]
```

2. Next, we'll set the center from which chunks will start generating, if you have a Survival server. For example, enter the coordinates of your Spawn XZ (If you don't enter this command, the chunk loading will start from the default spawn of the world).

```
/chunky center [coordinate X] [coordinate Z]
```

3. Now we'll set how many chunks we want to load. Keep two things in mind. The more chunks we load, the longer it will take, and the more chunks we load, the more storage it will use and generate the world.

```
/chunky radius [Numeric number of chunks]
```

4. Now, finally, the process begins! You'll see the percentage of charging progress in the console.

```
/chunky start
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plenix.net/guides/minecraft-guides/server-optimization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
