Understanding FiveM Performance Metrics
FiveM runs at a target 60 Hz (60 ticks per second), but every resource and player eats into that budget. Three metrics matter: server FPS (should be 60, drops indicate server-side lag), player ping (network latency — should be <50ms), and resource CPU time (each resource's contribution to server load). txAdmin shows all three in the Performance Monitor tab. A drop to 45 FPS is noticeable to players; 30 FPS feels laggy; anything below 20 is unplayable.
Resource Audit — Find the Lag Culprits
Open txAdmin's Performance Monitor. Sort resources by CPU time (ms). Any resource consistently above 0.5ms per tick is a candidate for optimization. Focus on the top 5 consumers — they typically account for 80% of server load. Common culprits: poorly optimized inventory scripts that scan all items every tick, vehicle scripts that loop through all spawned vehicles, and database queries that run synchronously instead of async. Ask the resource developer for optimization advice before removing it.
Database Optimization
Slow database queries are the #1 hidden cause of FiveM lag. Switch from mysql-async to OX MySQL — OX MySQL is significantly faster and handles connection pooling properly. Add indexes to frequently queried columns: owner in owned_vehicles, identifier in users, and job in job_grades. Run 'EXPLAIN SELECT' on slow queries to identify missing indexes. Consider moving the database to a separate VPS if you're running 3+ FiveM servers on one machine — database contention is a common bottleneck.
OneSync and Player Limits
OneSync is FiveM's network optimization system. Set OneSync population in server.cfg: 'onesync_enableInfinity 1' (handles large player counts), 'onesync_population true' (correct population display). Don't exceed the player slot limit of your plan — if your plan is 32 slots but you set sv_maxclients to 64, every extra player degrades everyone's experience. Match sv_maxclients to your plan capacity. Use 'onesync_big 1' if you have 64+ players.
Resource Streaming and Asset Management
Custom vehicles, maps (MLOs), and clothing (EUP) are streamed to players. Too many custom assets cause: slow player connections (30-60 seconds instead of 5-10), client-side FPS drops, and server memory bloat. Audit your stream folder: remove unused assets, compress large textures, and use asset packs instead of individual files. Set resource priorities: give essential resources (framework, inventory) higher priority than cosmetic ones (clothing, vehicle mods) so critical systems always get CPU time.
Scheduled Maintenance
FiveM servers accumulate issues over uptime. Schedule: daily restarts during low-population hours (use txAdmin Scheduler), weekly resource audits (remove/optimize top CPU consumers), and monthly database optimization (vacuum, analyze, remove old data). Restarting clears memory leaks, re-initializes resources, and drops stale database connections. A well-maintained server runs smoothly for 200+ hours; an un-maintained server degrades within 48.
FAQ
Related Tutorials
From the Blog
Was this guide helpful?
Join our Discord for more guides and direct help from our engineering team.
