Skip to content
CyberNex
CyberNex
services
Back to Knowledge Base
FiveM8 min

How to Optimize FiveM Server Performance

Proven techniques to boost your FiveM server's FPS and reduce lag. Resource optimization, OneSync configuration, and hardware recommendations.

Server.cfg Optimization

Set sv_maxclients to your plan's capacity (don't overcommit). Match sv_enforceGameBuild to current build. Enable onesync_enabled for population sync. Set onesync_distance to 300 (from default 500) for 64+ player servers. Reduce sv_maxPing to 300 to kick high-latency players that cause desync. Set sv_queueMaxSize to 16 to prevent connection flooding. Each restart applies changes.

Resource Optimization

Profile with txAdmin's Live Monitor — any resource > 1ms tick time is a problem. Common fixes: replace heavy resources with lighter alternatives (qb-phone → gcphone, qb-hud → lightweight HUD), set resources to 'dependency' instead of 'ensure' so they only load when needed, remove unused resources entirely, update all resources to latest versions (older versions often have memory leaks), and restart problematic resources every 12 hours with a scheduled task.

OneSync Configuration

OneSync Infinity for 128+ slots: set onesync_enableInfinity 1. For 32-64 slots, standard OneSync is sufficient. Population multiplier: onesync_population 1 enables AI population (traffic, pedestrians). Increase sv_endpoint_bandwidth to handle player data throughput. Test with expected player count — OneSync's CPU overhead scales with sync distance and player count.

Database Optimization

MySQL/MariaDB is heavily used by FiveM RP servers. Optimize: set innodb_buffer_pool_size to 50-70% of available RAM, enable query cache (query_cache_size 64M), set max_connections to match your player count + 20, create indexes on frequently queried columns (player identifiers, item IDs), run OPTIMIZE TABLE weekly on high-write tables. Slow database queries cause server-side lag spikes.

When to Upgrade Hardware

Upgrade if: txAdmin shows consistent CPU >80%, players report desync or teleport lag, resource tick time exceeds 10ms total, or you're adding 10+ new resources. Our plans scale from 2GB to 16GB with instant upgrades. For very large communities (100+ concurrent), consider VDS for dedicated CPU cores.

Frequently Asked Questions

Why does my server lag with 50 players but run fine with 30?

Likely a resource leak or CPU bottleneck. Resources that work fine under light load (30 players) may have inefficient code that scales poorly with more players. Profile at 50 concurrent players and identify the resource(s) consuming the most tick time.

How often should I restart my FiveM server?

Daily restarts recommended (early morning, low population). Some resources have slow memory leaks that accumulate over 12-24 hours. Automated restarts via txAdmin scheduler prevent crashes during peak hours.

Still have questions?

Our support team is available 24/7 on Discord. Join our community for real-time help from engineers who run game servers.

How to Optimize FiveM Server Performance | CyberNex Knowledge Base