If your FiveM server is lagging, stuttering, or struggling as more players join, the fix is almost always a combination of small optimizations rather than one magic setting. Here's a complete, practical checklist you can work through from top to bottom.
1. Audit your scripts with resmon
Start here, because scripts are the most common culprit by far. Open resmon (F8 โ resmon 1) and look for resources consuming high CPU time, especially while idle. Anything sitting above ~1ms doing nothing is a problem. Replace, update, or remove offenders. Our resmon guide walks through this in detail.
2. Cut resources you don't use
Every running resource costs something. Server owners accumulate scripts they tested once and forgot to remove. Go through your server.cfg and ensure list โ if you're not using it, stop starting it. A leaner server is a faster server.
3. Prioritize well-built scripts
The quality of the scripts you run matters more than almost anything else. A single bloated script can cost more than your entire framework. Favor resources built on the ox stack and event-driven logic over frame-by-frame polling.
4. Tune your server.cfg
Several settings directly affect performance:
- OneSync โ make sure it's set correctly for your player count. It's required for modern servers and shifts sync work appropriately.
- Player slots โ don't set your max players wildly higher than you actually get; it affects resource allocation.
- onesync_population and related settings โ tune NPC and vehicle density, which has a real performance cost.
We cover these in depth in our server.cfg optimization guide.
5. Check your database
A slow or misconfigured database causes lag that resmon won't show you (because it's server-side). Make sure:
- You're using oxmysql with a properly configured connection string.
- Your MySQL/MariaDB server has adequate resources.
- Scripts aren't hammering the database with excessive queries. The server-side
profilercommand helps find these.
6. Get adequate hosting
You can optimize all day, but if your server runs on underpowered hardware, you'll hit a wall. FiveM heavily favors single-thread CPU performance โ a high clock speed matters more than lots of cores. Whether self-hosting or using a provider, prioritize strong single-core performance and enough RAM for your player count.
7. Manage NPC and vehicle density
Ambient NPCs and traffic are surprisingly expensive. If your server doesn't need dense city traffic, reducing population density through your settings or a population script can free up meaningful performance.
8. Keep everything updated
Framework updates, artifact (server build) updates, and script updates often include performance improvements and bug fixes. Running months-old artifacts can cost you performance and stability. Update deliberately (test first), but don't fall years behind.
9. Monitor under real load
A server that runs fine empty can fall apart with 40 players. Test under realistic load, watch resmon and server-side profiling during peak times, and address what actually spikes rather than guessing.
The mindset
Optimization isn't a one-time task โ it's an ongoing discipline. Every time you add a script, check its cost. Every time you notice lag, profile before you guess. Servers that stay smooth are run by owners who treat frame time as a budget to protect.
The biggest lever of all is what you choose to install. At Viper Development, we build scripts specifically to be light on resources โ so adding our resources helps your server stay fast rather than dragging it down. Browse our optimized FiveM scripts โ