FiveM · Performance tips

FiveM server performance tips

How much RAM a FiveM server needs, how to find laggy scripts with the profiler, fix hitch warnings, and keep a busy roleplay server smooth.

By Last reviewed 4 min read

FiveM servers are coming soon

Cfx.re only lets hosts it has authorized sell FiveM servers, and servers on other hosts get blocked. FiveM opens on Wilderack the day Cfx.re approves us as a hosting partner. These guides are ready for the day we open.

Join the FiveM waitlist

A FiveM server’s speed depends mostly on its scripts, not on GTA V itself. Most lag comes from one or two badly written resources, so the best fix is to find them with FiveM’s profiler and replace or tune them. RAM matters too: plan 4 GB for a light server and 8 GB or more for a roleplay framework.

How much RAM you need

RAM is the server’s memory. Every resource uses some, and the database for a framework needs its share too.

Your server Players RAM
Freeroam, drift or racing, few scripts Up to 32 4 GB
QBCore, ESX or Qbox with a normal script list Up to 48 8 GB
Big roleplay city, many custom cars, maps and jobs 48 to 128 12 to 16 GB
Very large community Over 128 16 GB or more, and careful script choices

Custom cars, maps and clothes mostly cost download size and players’ own memory. Scripts cost the server’s CPU and RAM.

Reading the graphs on Overview

Overview shows CPU, RAM, players and network for the last 24 hours and 7 days.

  • RAM that climbs all day and drops after a restart means a resource leaks memory. A daily restart hides it. The profiler and the Console help find it.
  • CPU spikes when players join are normal while they load in. Spikes all the time point to a heavy script.
  • RAM close to your plan’s limit means it’s time for a bigger plan or fewer resources.

txAdmin also draws a chart of the server’s threads with the player count, which shows when hitches happen.

Hitch warnings

The Console prints a line like server thread hitch warning: timer interval of 1331 milliseconds when one round of the server’s work takes too long. Players feel it as rubber-banding and delays.

  • A few when the server starts or a big resource loads are normal.
  • Many in a row, or numbers in the thousands, mean a script is doing too much at once.

Find slow scripts with the profiler

FiveM has a built-in profiler that records which resource uses the time.

  1. Wait for a busy moment, when the lag happens.
  2. In the Console, type profiler record 500 to record 500 frames.
  3. Type profiler status to see when it’s done.
  4. Type profiler saveJSON profile.json to save it to the server’s folder.
  5. Download profile.json from Files.
  6. In Google Chrome, open the developer tools (Ctrl + Shift + I), go to Performance, right-click the panel and choose to load the profile.
  7. Look for tall spikes in the CPU graph. Zoom in, and the resource and line number behind each spike are listed.

The same commands in the F8 console in game profile the client side, which helps when players get low frame rates on your server.

Settings that help

These lines in server.cfg tune OneSync, FiveM’s server-side sync. Change one at a time and test.

Line Default Try Effect
set onesync_population true false Turns off the game’s own traffic and pedestrians. Saves a lot of work, but the city feels empty. Only for servers that don’t want AI
set onesync_distanceCullVehicles false true Stops sending far-away cars to players who can’t see them
set onesync_distanceCulling true Keep true Stops sending far-away entities. Leave it on

Script choices matter more than settings:

  • Pick resources that are known to be light. Many authors list their idle cost, in milliseconds, on the release page.
  • Remove scripts you don’t use, instead of leaving them installed.
  • Avoid stacking several scripts that do the same job, like two HUDs or two garages.
  • Keep your framework and its scripts on matching versions.

Restarts

Long-running FiveM servers slowly use more memory. A daily restart at a quiet hour keeps things fresh.

  1. Open Schedules and add the Daily restart with warnings preset.
  2. Set the time to when the fewest players are on, like 5:00.
  3. Players get warnings 5 minutes and 1 minute before.

txAdmin can also schedule restarts. Use one or the other, not both, or the server restarts twice.

Keep the server files recent

Cfx.re fixes performance bugs in new server builds (artifacts). Stay on a recent recommended build: it’s supported for six weeks after the next one comes out. The version is in Settings.

Pick the right region

Players feel the distance to the server as ping. Pick the region where most of your players live: EU or US East. If your community is split, pick the side with more regular players.

Questions

How much RAM do I need for a FiveM roleplay server?

8 GB is a good start for QBCore, ESX or Qbox with up to about 48 players. Big servers with many custom cars, maps and scripts need 12 GB or more.

What does server thread hitch warning mean in FiveM?

It means one round of the server's work took far longer than it should, usually because a script did too much at once. Use profiler record in the console to find which script.

Does a FiveM server need daily restarts?

It helps. Many scripts slowly use more memory over time, and a daily restart at a quiet hour clears it. Set one up in Schedules with in-game warnings.

Sources we checked

  1. Using the profilerCfx.re
  2. Server commands (OneSync options)Cfx.re
  3. txAdmin featuresCfx.re

Be first to host FiveM

Cfx.re only lets hosts it has authorized sell FiveM servers, and servers on other hosts get blocked. FiveM opens on Wilderack the day Cfx.re approves us as a hosting partner. Join the waitlist and we’ll email you the day it opens.

Wait! Get 25% off your server

Don’t miss the best FiveM hosting.

Date of birth

We keep only your email and where you signed up, to send you launch news and your code. Your birth month and year are checked, never stored. Every email has an unsubscribe link, or write to privacy@wilderack.com. Your data, in plain words.

25% off your first payment, for new customers. Your code arrives by email. Then the normal price; cancel any time.