# How to Optimize Your FiveM Server Performance (/docs/fivem/optimize-performance)



import { Step, Steps } from 'fumadocs-ui/components/steps';

Enable OneSync [#enable-onesync]

**OneSync** replaces the default peer-to-peer sync with server-authoritative entity synchronization. It's required by both ESX and QBCore, and increases the player cap from 32 to 2048.

In `server.cfg` (via **Files** in the [XGamingServer Panel](https://panel.xgamingserver.com)):

```ini
set onesync on
```

| Mode            | Max players | Description                                                    |
| --------------- | ----------- | -------------------------------------------------------------- |
| `on` (Infinity) | 2048        | Recommended — full server-side sync with population management |
| `legacy`        | 64          | Older mode, no server-side population                          |
| `off`           | 32          | Default GTA Online sync                                        |

OneSync Infinity is the current recommended standard.

Performance Convars [#performance-convars]

Add these to `server.cfg`:

```ini
# Entity lockdown — prevents clients from creating unauthorized entities
sv_entityLockdown strict

# Script hook control
sv_scriptHookAllowed 0

# Duplicate player checking
sv_duplicatePlayers true
```

Reduce Resource Load [#reduce-resource-load]

1. **Remove unused resources** — every `ensure` in server.cfg loads a resource. Remove what you don't use
2. **Check resource monitor** — in txAdmin, view the Resources tab to see CPU/memory per resource
3. **Avoid heavy client-side scripts** — large MLOs, high-poly vehicles, and complex UI scripts increase load times
4. **Limit streaming assets** — each addon vehicle/MLO increases client download time and memory usage

Server Artifacts [#server-artifacts]

Keep your server artifacts (FXServer build) up to date. Newer builds include performance improvements and bug fixes. Update via **Reinstall Server** on the **Dashboard**.

Related Guides [#related-guides]

* [Server Configuration](/docs/fivem/configure-your-server)
* [Server Ports](/docs/fivem/server-ports)
* [Clear Cache](/docs/fivem/clear-cache)
