Back to Blog

FiveM Optimization: From 30 to 60 FPS on a Busy Server

FiveM performance is a server-and-client conspiracy: a single bad script tanks everyone's FPS, then bad client settings make players blame the server. This guide separates the two, gives you a measurement-first playbook, and covers the fixes that actually move the needle in 2026 — not the placebo tweaks that pad the YouTube videos.

"FiveM runs at 30 FPS" is almost never the actual problem. The actual problem is usually one of:

Our recommended FiveM hoster

For the CPU performance and DDoS protection FiveM needs, we recommend Avoro — German-based, Ryzen 9 7950X3D nodes, always-on DDoS, real unmetered traffic. See our FiveM hosting comparison.

  1. A single misbehaving server-side script causing client-side stalls.
  2. Too much streamed content (cars, MLOs, custom peds) for the client's VRAM.
  3. Database queries blocking the server main thread.
  4. Game settings cranked higher than the GPU can sustain.
  5. Anti-cheat or "loop hooking" overhead that nobody profiled.

This guide walks the server-side first (you own that), then the client-side (you can advise on it). Skip to the section relevant to your role.

Step 0: measure before you optimize

Optimization without measurement is superstition. Two tools you need:

resmon (in-game, F8)

Open the console with F8, type resmon, Enter. You get a live table of every running resource, its CPU time per tick (ms), memory usage, and network usage.

  • Idle resmon per resource should be under 0.10 ms. Anything above 0.30 ms is suspicious. Above 1.0 ms is a problem.
  • Sort by CPU (column header) to find the worst offenders.
  • Switch between server and client view — they're different tables.

txAdmin live console + perf monitor

txAdmin tracks server thread hitches. Watch for server thread hitch warning: timer interval of XXX ms in your console. Above 200 ms is bad, above 1000 ms is broken-feeling for players. Hitches usually correlate with a DB query or sync HTTP call. Identify the resource that fires right before/during the hitch.

Server-side optimization

1. Find and kill resmon-hogs

Open resmon while server is idle (no players). Any resource at >0.30 ms idle is doing something wrong. Common culprits:

  • A CreateThread with a tight while true do loop and Wait(0) instead of Wait(500). Look for that pattern in client code.
  • A blip-update thread polling every frame instead of on player position change.
  • An "anti-cheat" script doing per-tick global checks (these often run at 0.50-2.0 ms idle).
  • Dead scripts left from old experiments that nobody removed from server.cfg.

Action: stop <resource> for each suspect one at a time and re-check resmon. The drop tells you the cost.

2. Fix slow database queries

oxmysql logs slow queries by default. Watch your console for lines like:

[oxmysql] [12.0.2-MariaDB] devCon_factions took 16472.2469ms to execute a query!

16 seconds for a query is a server-killing event — everyone hitches for the duration. Common causes:

  • Missing index on a JOIN column. Look at the query, identify the columns in WHERE / JOIN, run SHOW INDEX FROM <table>. If the column isn't indexed, add one: CREATE INDEX idx_x ON tab(col);
  • SELECT * on a giant table. Replace with explicit column list. SELECT * across 50k rows when you need 3 columns wastes serialization time.
  • JOIN with no LIMIT. A heatmap-style query loading all owned_vehicles might do something stupid like a self-join. Profile with EXPLAIN.
  • oxmysql warning: oversized result set. SELECT * FROM hex_radioapp_history returning 117k rows = pulling the entire table into Lua. Add a date filter or pagination.

Single biggest win for most servers: index the columns your scripts query by. 10 minutes of work, transforms 16-second hitches into 2 ms queries.

3. OneSync Infinity tuning

Edit your server.cfg:

set onesync on
sv_maxclients 64

# Population density — lower means fewer NPCs, big FPS gain
set sv_enforceGameBuild 3258
set onesync_distanceCullVehicles true
set onesync_radiusFrequency 50
set onesync_population true

The biggest population lever is whether you stream NPCs at all. Many RP servers run with sv_enforceGameBuild set and disable scenarios via a client mod or an entity-streaming script. Half the FPS budget on busy servers goes to NPC simulation that nobody role-plays with.

4. Resource streaming hygiene

Every custom vehicle, ped, MLO, weapon costs VRAM on every client. The asset isn't free even when nobody's looking at it — FiveM preloads streamed assets at resource start.

Tactics:

  • Audit your stream/ folders. Anything not actively used should be removed.
  • Convert YFT/YTD assets to compressed format where you can.
  • Use cl_data packs for assets that aren't always needed — load on demand instead of eagerly.
  • Custom vehicle handling files should be in stream/, not the main resource. Wrong location wastes resmon.

5. The cache server play

An external nginx caching proxy is the single biggest player-experience win for any server above 50 players. Players downloading a 3 GB asset pack from your FXServer kills join times. From a cache server, downloads finish in 1/4 the time and your main server stops being asset-bound.

We have a full guide on setting up a FiveM cache server — typical ROI is paying €5/month for a Hetzner CX22 and getting back 40% of your FXServer's CPU during peak join times.

6. Voice on its own server

pma-voice on the main FXServer fights every other resource for CPU on busy servers. Moving it to a dedicated voice server (€5/month VPS) reclaims a measurable chunk of main-server budget. Full setup guide here.

7. Anti-cheat overhead

Most "anti-cheat" scripts add 0.5-2.0 ms client-side resmon per tick. Multiply that by every client and the overhead is real. Audit yours: open resmon on a client, find your AC's name, check the cost. If it's above 1.0 ms idle, consider switching.

Client-side optimization

Server-side is your responsibility; client-side is your players' — but you should know enough to advise them when they complain.

1. Don't use a streamer-overlay mod

NVIDIA ShadowPlay, OBS, Discord overlay all cost FPS. If a player is at 30 FPS, ask them to disable overlays and recheck. Often that alone gets them to 50+.

2. Graphics settings that actually matter

In GTA V settings menu, these are the levers worth pulling:

  • Population Density / Variety — drop to 50%. RP servers don't need NPC crowds; you're with other players anyway.
  • Distance Scaling — drop to 60-70%. Massive FPS win, barely noticeable on busy streets.
  • Shadow Quality — Normal, not High. Shadow rendering is one of the biggest GPU consumers.
  • Grass Quality — Normal or below. High grass is GPU-expensive and you're rarely in the countryside.
  • Reflection Quality — Normal. High reflections are 10-15% FPS for marginal visual improvement.
  • MSAA — turn off. FXAA is fine for FiveM.
  • Advanced Graphics → Long Shadows — off. This is the single biggest hidden FPS killer.
  • Tessellation — Normal. Very High tessellation costs 5-8% FPS for stuff you can't see.

3. Resolution scale

Players running at 4K with a 1080-tier GPU should drop to Render Scale 0.75. FiveM's TXAA does fine work upscaling — most players can't tell the difference.

4. FiveM-specific client tweaks

In FiveM settings (the F1 menu before connecting):

  • Streaming memory limit — set to about 60% of your VRAM. Too high causes streaming stalls; too low causes pop-in.
  • GPU usage policy — set FiveM to use the discrete GPU explicitly in NVIDIA Control Panel. Players on laptops with iGPU+dGPU often run on the wrong GPU.

5. The "FiveM is unplayable on my CPU" reality

FiveM is mostly CPU-bound, not GPU-bound. A 4-core CPU from 2018 will struggle on any populated server regardless of graphics settings. Quad-core players need to know: graphics tweaks won't help them; CPU upgrade will.

Modern threshold (2026): 6 cores, 3.5+ GHz base, 16 GB RAM, GTX 1660 / RX 5600 or better. Below that you're optimizing into diminishing returns.

Common myths

"GTA5.exe -no_browser will boost FPS"

This was true in 2018-2019. Today FiveM's browser process is well-contained and the flag actually breaks several scripts. Don't use it.

"Disabling NUI gives more FPS"

You can't disable NUI — it's what renders most in-game menus including the F8 console, ESX/QBCore HUDs, phone apps. Disabling it makes the server unplayable.

"Custom DLLs make FiveM faster"

Anything claiming to "boost FPS" via injected DLL is either useless or a token-stealer. The Cfx.re client is already optimized. No third-party DLL "tweaks" make a difference.

"Set CPU affinity to FiveM"

Modern Windows scheduler handles this fine. Manual affinity changes mostly make things worse. Skip.

Workflow: a real optimization session

How we'd actually approach a "my server lags" ticket:

  1. SSH into the server, tail txAdmin console. Note any hitch warnings >500 ms.
  2. Join the server. Open F8 → resmon. Sort by CPU. Note top 5 client-side resources.
  3. Switch to resmon server. Note top 5 server-side resources.
  4. Reproduce a problem area (heavy job site, server-restart join wave). Watch which resources spike.
  5. Check oxmysql logs for slow queries during the spike.
  6. Pick the worst offender. Stop it. Re-test.
  7. Either: (a) fix the offender if it's your code, (b) replace it with a better-built script, or (c) ask the script vendor for a fix.
  8. Repeat until idle resmon < 5 ms total across all resources.

Most servers reach a stable optimization point after 3-4 such sessions. After that you're chasing diminishing returns.

Hardware: when to upgrade

Server hardware

FXServer is mostly single-threaded for the main game loop. Single-thread CPU performance matters more than core count. A modern Ryzen 5/7 or Intel i5/i7 with high base clock (4.0+ GHz) beats a 32-core Xeon for FiveM hosting.

RAM: 16 GB minimum, 32 GB comfortable for 100-player servers with lots of resources.

Disk: NVMe SSD mandatory. SATA SSD acceptable for cache servers but main FXServer wants NVMe for resource loading times.

Network: 1 Gbps uplink minimum. Unmetered traffic is essential — busy servers push 5-15 TB/month.

Hetzner / OVH / Server4You comparison

For most EU communities, Hetzner is the safe default — good single-thread CPUs, 1 Gbps unmetered, central German DC location for low ping. OVH has DDoS protection edge but their cheaper plans have worse single-thread performance. Server4You is fine for small servers; not recommended for 100+ slots.

What we did at devCon

We host our own scripts on a Hetzner AX52 (8 cores, 64 GB RAM, NVMe), running 130 resources with 80 simultaneous players, peak resmon under 3 ms total. The path there involved every step in this guide: cache server, voice on dedicated box, indexed DB queries, dropped 40 garbage scripts we'd accumulated over the years.

If you want our script bundle that we built with this same performance philosophy — every script tested for <0.05 ms idle resmon — that's what we sell at devCon Studio.

Related reading