Server lag kills roleplay communities. When players rubberband, desync happens in combat, and vehicles teleport, people leave and don't come back. Performance optimization is the difference between a thriving RP server and a ghost town. This guide covers every technique to maximize your FiveM server's FPS and minimize lag.
Understanding FiveM Server Performance
FiveM server performance is measured in 'tick rate' or 'server FPS'. The server processes game logic in discrete ticks - by default, 128 ticks per second. A healthy server maintains 50-60 FPS (server-side). When FPS drops: player positions update slowly (rubberbanding), vehicle physics become unreliable, combat becomes unfair (shots not registering), scripts lag (inventory doesn't open, commands take seconds). Three things consume server resources: game simulation (world, players, vehicles, NPCs), script processing (all your resources running every tick), and network processing (player connections, data sync). Optimization means reducing the load of each.
server.cfg Performance Tuning
Your server.cfg is the first optimization layer. Critical settings: sv_mainthreadrate - controls how often the main thread updates. Set to 4 for performance (lower values = more CPU usage but better sync). sv_enforceGameBuild - set to the current FiveM build (b2944+ for 2026). sv_scriptHookAllowed 0 - disable script hook if you don't need it (prevents external script injection). onesync_enabled 1 - always enable OneSync for better performance. onesync_population 0 - disable AI civilians and traffic if your server is player-driven RP (saves 20-30% CPU). sv_maxclients - never set higher than your plan can handle. sv_maxPing 300 - kick extremely high-ping players. sv_endpoint_bandwidth_up/down - set to 100000000 (100 Mbps) or higher.
Resource Profiling and Optimization
Resources (scripts) are the #1 source of lag on most FiveM servers. Profile with txAdmin's Live Console: open the Performance tab, sort by 'Tick Time', and identify resources consuming >1ms per tick. Common culprits and fixes: qb-phone or esx_phone - heavy due to constant UI updates. Replace with gcphone or disable unused phone apps. OX Inventory - excellent but disable item animations (set Config.UseAnimations = false) and reduce refresh rate. QB HUD - the default HUD is heavy. Replace with a lightweight status bar or reduce update frequency. Map mods (MLOs) - remove unused map modifications. Each MLO interior adds load. Vehicle handling mods - every vehicle model increases loading times. Remove unused vehicles from your resources. esx_status / qb-core status - set status update interval to 5000ms+ (default is often 500ms, 10x too frequent).
OneSync Optimization
OneSync is essential for performance but must be configured correctly. onesync_population 1 enables server-managed AI (pedestrians, traffic). Set to 0 for pure RP servers where players are the only characters. onesync_distance cap: set to 300-400 meters for 64+ slot servers to reduce sync data. Beyond this distance, entities stop syncing. onesync_enableInfinity 1 required for 128+ slots but increases CPU usage significantly. Only enable if you actually have 128+ concurrent players. BP (Big Ped) optimization: if you have custom peds/models, set 'sv_syncPlayerComponents 0' to disable player ped component replication - saves bandwidth and CPU at the cost of less detailed player models. Test OneSync settings with your actual player count - the impact scales linearly with connected players.
Database Optimization
Many FiveM resources query the database every tick - this is a hidden performance killer. Common offenders: vehicle inventory systems that check database on every interaction, housing scripts that load/save furniture positions per tick, job scripts that poll salary tables constantly, player status systems with per-tick DB writes, economy scripts that validate every transaction against the database. Fixes: add caching layers to scripts (cache player data for 5-10 seconds), batch database writes (write every 30 seconds instead of every tick), use MySQL connection pooling (set pool size to 10-20 connections), and ensure database indices are on commonly queried columns (identifier, citizenid, owner). Use HeidiSQL or phpMyAdmin to check slow queries. A single slow database query can freeze the entire server for 100ms+ - players notice that.
Advanced Performance Techniques
For servers with 64+ players: limit entity counts (vehicles, dropped items, props). Use 'sv_OversizedEntityLimits 0' to enforce reasonable limits. Enforce asset streaming budgets with 'sv_DisableServerVehicleLivery 1' (disables livery sync if not used). Use 'sv_forceIndirectListing true' for better server list performance. For resource loading: order your server.cfg so heavy resources start first (ensures they're ready before players join). Restart heavy resources daily via a scheduled task to clear memory leaks. Use 'setr sv_debug 1' temporarily to profile - this shows detailed resource timings in console. Set 'sv_syncPlayerBuildings 0' to disable building sync (saves bandwidth). For truly large communities (128+), consider a load-balanced architecture: separate core framework from optional resources, run a proxy layer for API calls, and use Redis for shared caching across resources.
Hardware and Hosting: The Foundation
Even the best-optimized server can't overcome inadequate hardware. CPU: FiveM benefits from high clock speeds (4.5GHz+) and multiple cores. High-performance CPUs at 5.7GHz are ideal. A Xeon at 3.5GHz will struggle regardless of optimization. RAM: 4GB minimum for 32 slots, 8GB for 64 slots, 16GB+ for 128 slots. DDR5 bandwidth helps with data-heavy resources. Storage: NVMe is essential. World streaming and database operations are I/O heavy on large servers. Network: at least 1 Gbps port, DDoS protection (17 Tbit at CyberNex), and low-latency routing to your player base. CyberNex FiveM plans use high-performance CPUs, DDR5 RAM, and NVMe SSDs across all tiers - providing the hardware foundation that makes software optimization actually work.
FiveM performance optimization is a continuous process. Start with server.cfg and OneSync tuning, profile resources weekly with txAdmin, optimize database queries, and upgrade hardware when needed. A well-optimized FiveM server on a CyberNex 8GB plan handles 64 players at a stable 60 FPS server-side with 50+ resources. The key is regular profiling - what's optimal today changes as you add resources and grow your community.

Mohammed is a DevOps engineer at CyberNex who manages the hosting platform's deployment automation, monitoring systems, and security infrastructure. He contributes technical guides on server administration and security best practices.
CredentialsDevOps engineer at CyberNex with 5+ years managing hosting infrastructure. Specializes in automated deployment pipelines, server security hardening, and performance tuning for game server workloads across distributed systems.
More in fivem
Game Server Hosting
Launch your FiveM server with txAdmin pre-installed. ESX, QBCore, vRP. DDoS protected.




