Press Enter to search

HomeGuides › Server Optimization

FiveM Server Optimization:
Reduce Lag & Boost FPS in 2026

The complete guide to making your FiveM server run faster. From vehicle texture optimization to script profiling — every proven technique to hit 60+ FPS for all your players.

Updated: April 2026 18 min read By the FiveMRides Team

Why FiveM Servers Lag (The Real Causes)

Before you can reduce lag on your FiveM server, you need to understand what causes it. Most server owners blame their hosting, but the truth is that 90% of FiveM performance problems come from unoptimized resources, not hardware. Here is the performance bottleneck hierarchy for a typical FiveM roleplay server:

1. Vehicle Textures (Biggest Impact)

Unoptimized vehicle YTD files are the #1 cause of FiveM lag. A typical RP server with 150-300 addon vehicles streams 2-6 GB of texture data to every connected player. Most custom vehicles ship with 2048-4096px textures when FiveM caps at 1024px — wasting bandwidth and VRAM for zero visual benefit. This causes texture loss, stuttering, and FPS drops for every player on the server.

Fix: Optimize all vehicle textures to proper formats and resolutions. This alone can improve server-wide FPS by 20-40%.

2. Poorly Written Scripts

Scripts that run expensive operations every frame (tick), make unnecessary native calls, or have unthrottled loops can consume 5-15ms of CPU time per frame. Since FiveM targets 16ms per frame (60 FPS), a single bad script can cut your framerate in half. The worst offenders are HUD scripts with per-frame UI updates, proximity checks without spatial indexing, and vehicle spawn systems that don't cleanup entities.

3. Too Many Resources

Every running resource has a base CPU cost even when idle. Servers with 200+ resources (common for feature-rich RP servers) accumulate significant overhead. Each resource also adds to the loading time for connecting players. The solution is not to remove features, but to audit which resources are actually used and combine lightweight ones where possible.

4. Database Bottlenecks

ESX and QBCore servers make frequent database queries for player data, inventory, vehicles, and properties. Unindexed tables, N+1 query patterns, and synchronous database calls on the main thread can create lag spikes. A single slow query (100ms+) causes a noticeable stutter for every player.

5. Entity Overload

FiveM's OneSync system manages entity routing between server and clients. Every spawned vehicle, ped, object, and pickup is an entity. Servers with 1000+ simultaneous entities (e.g., persistent parked cars, NPC populations, dropped items) force the routing system to work harder, increasing server-side CPU load and network bandwidth.

6. Network & Hardware

Insufficient server CPU (single-thread speed matters most for FiveM), slow storage (HDD instead of SSD), or poor network routing can bottleneck performance. But this is rarely the primary cause — optimizing resources and scripts usually provides 10x more improvement than upgrading hardware.

Step 1: Optimize Your Vehicle Resources

This is the single most impactful step you can take to boost FPS and reduce lag on your FiveM server. Vehicle textures consume more streaming bandwidth than any other resource type.

Why Vehicle Textures Matter So Much

Every addon vehicle on your server ships with YTD texture dictionaries containing diffuse (color), normal (surface detail), and specular (shininess) maps. A single unoptimized vehicle can have 20-40 MB of texture data. Multiply that by 200 vehicles and you are streaming 4-8 GB of textures to every player.

FiveM's client enforces hard limits: str_maxVehicleTextureRes caps at 1024px and str_maxVehicleTextureResRgba at 512px. Any texture larger than this gets downscaled at runtime, but the full-size file was already streamed to the client. This wastes bandwidth, VRAM, and CPU cycles for zero visual benefit.

The Smart Compression Approach

Not all textures should use the same compression format. The FiveMRides Optimizer uses smart per-type compression that applies the optimal format for each texture type:

Texture Type Best Format Why Savings vs Uncompressed
Diffuse (color, no alpha)DXT1 / BC14:1 ratio, sufficient for color data75%
Diffuse (with alpha)DXT5 / BC3Preserves transparency data75%
Normal maps (_n, _n2)BC5 / ATI2Uses both channels for X/Y surface — dramatically better than DXT575% + better quality
Specular maps (_s, _s2)BC7 / BPTCNear-lossless at same file size as DXT575% + better quality
Script RTSkipMust stay uncompressed for runtime rendering

Quick Math: The Optimization Impact

A server with 200 addon vehicles averaging 25 MB each = 5 GB total. After optimization with the Optimized preset: textures resized to 1024px, smart compression applied → average drops to 8-12 MB = 1.6-2.4 GB total. That is a 50-68% reduction in streaming data for every connected player.

How to Optimize All Your Vehicles

You have two options:

  1. Manual optimization — Open each vehicle in OpenIV, export textures, resize in Photoshop/GIMP, recompress, re-import. Takes 15-30 minutes per vehicle. For 200 vehicles, that is 50-100 hours of work.
  2. Automated optimization — Upload your vehicle resource to the FiveMRides Optimizer. It handles texture compression, resizing, AND 3D model decimation in ~30 seconds per vehicle. No software to install.

Optimize Your Vehicles Now

Upload any FiveM vehicle resource and get an optimized version in seconds. Smart BC5/BC7 compression + 3D model decimation. 40-70% file size reduction.

Open the Optimizer — Free Trial

Step 2: Profile & Fix Laggy Scripts

After vehicle optimization, script profiling is the next biggest performance win. FiveM gives you built-in tools to identify problem scripts.

Using resmon to Find Lag Sources

Open the FiveM console (F8) and type resmon 1. This opens the Resource Monitor, showing CPU time in milliseconds per resource per frame. The total should stay under 8ms for smooth 60 FPS gameplay.

Resource TimeStatusAction
< 0.5msExcellentNo action needed
0.5 - 2msAcceptableMonitor, optimize if possible
2 - 5msProblematicInvestigate and optimize
> 5msCriticalReplace or rewrite immediately

Common Script Performance Killers

Per-Frame Loops Without Waits

Scripts using while true do ... end without Citizen.Wait() run every frame (16ms). Most logic does not need per-frame updates. Add Citizen.Wait(500) or Citizen.Wait(1000) for checks that can tolerate a half-second delay (proximity checks, UI updates, status checks).

Excessive Native Calls

Calling expensive natives like GetGamePool('CVehicle') every frame iterates over all spawned vehicles. Cache results and update periodically instead. Similarly, GetEntityCoords on multiple entities per frame adds up quickly.

Entity Leaks

Scripts that spawn vehicles or peds without cleaning them up cause entity counts to grow over time. Implement proper despawn logic: delete entities when they are no longer needed, set entity routines to cull distant or unused objects.

Synchronous Database Calls

Using MySQL.Sync.execute() blocks the entire server thread until the query completes. Always use MySQL.Async.execute() with callbacks or promises. A single 50ms synchronous query causes a visible freeze for all players.

Step 3: Server Configuration & Convars

Essential Performance Convars

server.cfg — Recommended Performance Settings
# OneSync (required for modern servers)
set onesync on

# Entity lockdown - prevents client-side entity creation exploits
# Also reduces entity overhead
set sv_entityLockdown strict

# Script hook control
sv_scriptHookAllowed 0

# Network performance
sv_maxClients 64
set sv_streamingBudget 512

# Rate limiting
set rateLimiter_stateBag_rate 75
set rateLimiter_stateBag_burst 150

Resource Loading Order

The order you ensure resources in server.cfg matters. Load framework resources first, then dependencies, then feature scripts. This prevents race conditions where scripts try to access framework functions before they are loaded.

Common Mistake: Too Many ensure Statements

Some server owners ensure every subfolder individually, leading to 300+ resource starts. Each resource has startup overhead. Consider using [folders] to batch-load related resources, and remove any ensure statements for resources you are not actually using.

Step 4: Database Optimization

ESX and QBCore servers rely heavily on MySQL/MariaDB. A poorly optimized database causes lag spikes that affect every player simultaneously.

Quick Wins

  • Add indexes — The identifier column on player tables, plate on vehicle tables, and any column used in WHERE clauses should be indexed. A missing index on a table with 50,000+ rows turns a 1ms query into a 200ms query.
  • Use oxmysql or mysql-async — These libraries provide connection pooling and async query execution. Never use raw MySQL connections.
  • Clean old data — Delete old logs, expired bans, orphaned vehicles, and stale inventory data. Large tables slow down every query.
  • Tune MySQL — Set innodb_buffer_pool_size to 50-70% of available RAM on dedicated database servers. Enable slow_query_log to identify queries taking over 100ms.

Step 5: Hardware & Hosting

After optimizing resources, scripts, and database, hardware becomes the limiting factor. Here is what matters most for FiveM server performance:

ComponentPriorityRecommendation
CPUCriticalFast single-thread speed (4.5GHz+). FiveM is largely single-threaded. Intel i9 or AMD Ryzen 7+ recommended.
StorageHighNVMe SSD required. Asset streaming reads from disk constantly. HDD will bottleneck even an optimized server.
RAMHigh16 GB minimum, 32 GB for 64+ player servers with many resources.
NetworkMedium1 Gbps with low latency. Location matters — host near your player base.

Dedicated vs VPS vs Shared

Dedicated servers give the best performance: no resource sharing, full CPU access, predictable performance. VPS is good for small-medium servers (32-48 players) but performance varies depending on neighbors. Shared FiveM hosting is only suitable for testing — avoid for production roleplay servers.

Bonus: Client-Side FPS Boost Tips

Share these tips with your players to help them get better FPS on your server:

  • Texture Quality: Normal — Reduces VRAM usage significantly with minimal visual impact on modded servers.
  • Shader Quality: High — Dropping from Very High saves 10-15% GPU load.
  • Grass Quality: Normal — One of the most VRAM-hungry settings.
  • Extended Distance Scaling: 50-75% — Reduces distant texture loading, freeing budget for nearby vehicles.
  • Clear FiveM cache — Delete %localappdata%\FiveM\FiveM.app\data\cache\priv and server-cache folders periodically.
  • Disable overlays — Discord, GeForce Experience, and Xbox Game Bar overlays each consume GPU resources.
  • Set FiveM to High Priority — In Task Manager, right-click FiveM > Set Priority > High.

For a deeper dive on texture-related performance issues, see our FiveM Texture Loss Fix Guide.

The Complete FiveM Server Optimization Checklist

Use this checklist to systematically optimize your server. Start from the top — each step is ordered by impact.

Vehicle & Asset Optimization

  • Optimize ALL vehicle YTD textures (resize to 1024px, smart compression)
  • Verify no single YTD exceeds the 16 MB streaming limit
  • Decimate high-poly vehicle models (target 0.7-0.8 ratio)
  • Remove unused vehicle resources from your server
  • Check total streamed asset size (aim for under 2 GB)

Script Performance

  • Run resmon 1 and identify resources over 2ms
  • Add Citizen.Wait() to all loops that don’t need per-frame updates
  • Replace synchronous DB calls with async equivalents
  • Implement entity cleanup for spawned vehicles and peds
  • Cache expensive native call results

Server Configuration

  • Enable OneSync
  • Set sv_entityLockdown strict
  • Remove unused ensure statements from server.cfg
  • Order resources correctly (framework → dependencies → features)

Database

  • Index all frequently queried columns (identifier, plate, etc.)
  • Clean old/orphaned data from large tables
  • Enable slow query log and fix queries over 100ms
  • Use oxmysql or mysql-async with connection pooling

Infrastructure

  • Use NVMe SSD storage (not HDD)
  • Ensure CPU has fast single-thread speed (4.5GHz+)
  • Allocate adequate RAM (16-32 GB)
  • Host geographically close to your player base

Start With the Biggest Win

Vehicle texture optimization provides the single largest FPS improvement for your players. Upload your vehicle resources and optimize them in seconds.

Optimize Your Vehicles — Free Trial

Frequently Asked Questions

How many custom cars can a FiveM server handle without lag?

A well-optimized FiveM server can run 200-400 addon vehicles without noticeable lag. The key is optimization: compress all YTD textures to proper formats (BC5 for normal maps, BC7 for specular, DXT1/DXT5 for diffuse), resize to FiveM streaming limits (1024px max), and keep individual YTD files under 16MB. Unoptimized, even 50 vehicles can cause texture loss and stuttering.

What causes lag on FiveM servers?

The main causes of FiveM server lag are: 1) Unoptimized vehicle textures (oversized YTDs consuming too much streaming bandwidth), 2) Poorly written scripts with high resmon times, 3) Too many resources running simultaneously, 4) Database queries blocking the main thread, 5) Insufficient server hardware (CPU is most important for FiveM). Vehicle textures are the #1 cause because they directly impact every connected player's FPS.

How do I check which resources are causing lag in FiveM?

Use the built-in FiveM resource monitor by typing "resmon 1" in the F8 console. This shows CPU time per resource in milliseconds. Any resource consistently above 2ms deserves investigation. For vehicle-related lag, check your total streamed asset size: add up all YTD file sizes across your vehicle resources. If the total exceeds 2-3 GB, you need to optimize textures.

Does reducing polygon count on FiveM vehicles improve FPS?

Yes, but less than you might expect. The FiveM vehicle performance bottleneck hierarchy is: textures > LODs > polygon count > draw calls. Texture optimization gives the biggest FPS improvement (40-70% file size reduction). Polygon decimation provides a secondary 5-15% improvement. Both together provide the best results. The FiveMRides Optimizer handles both automatically.

What is the best server hardware for FiveM?

FiveM servers are primarily CPU-bound (single-threaded). Prioritize: 1) Fast single-core CPU speed (4.5GHz+ recommended), 2) NVMe SSD for fast asset streaming, 3) At least 16GB RAM (32GB for 100+ player servers), 4) Stable network connection with low latency. A dedicated server or high-performance VPS outperforms shared hosting significantly.

How do I optimize FiveM vehicle textures without software?

Use the FiveMRides Optimizer at fivemrides.com/optimizer — it is a free web-based tool that requires no software installation. Upload your vehicle resource ZIP, choose a preset (Optimized for zero quality loss, Maximum for aggressive compression), and download the optimized version. It applies smart per-type compression (BC5 for normals, BC7 for specular) and can reduce file sizes by 40-70%.

Should I use OneSync or legacy mode for better performance?

OneSync Infinity is recommended for all modern FiveM servers. It supports up to 2048 players (theoretically), handles entity routing more efficiently, and reduces network bandwidth compared to legacy mode. OneSync does require slightly more CPU on the server side, but the performance benefits for players far outweigh the cost. Almost all frameworks (ESX, QBCore) are OneSync-compatible.

How can I reduce FiveM loading times for players?

Reduce loading times by: 1) Optimizing all vehicle YTD files (smaller files = faster streaming), 2) Using proper LOD levels on vehicles (so distant cars load lightweight models first), 3) Removing unused resources from server.cfg, 4) Enabling server-side asset caching, 5) Using a hosting provider with fast NVMe storage and good network peering. Optimized servers typically load 30-50% faster.

Scroll to Top