Skip to content
FIVECRATE

FiveM resmon and Profiler: Find the Resource Causing Lag

How to use FiveM resmon and the profiler: fix Access denied for command resmon, read every resmon column, record a server profile and open it in Chrome.

Night city intersection with a floating performance dashboard of graphs above the traffic
Author: FiveCrate
Published:
Updated:
Read time: 22 min
Applies to
FiveM Legacy client and FXServer on Windows and Linux (public citizenfx/fivem source as of November 17, 2026), any framework; FiveM for GTAV Enhanced client and Cfx Server as described in the official docs and the July 15, 2026 development update
Last verified

Direct Answer

FiveM resmon is a client console command that opens the Resource Monitor, a live table of each client resource’s CPU time and memory. Press F8 and type resmon 1. “Access denied for command resmon” or “Command resmon is disabled in production mode” means developer mode is off: on FiveM Legacy, launch the game with +set moo 31337; on FiveM for GTAV Enhanced, the server must set sv_devMode true. The F8 window never shows server scripts. For server lag on Legacy, type profiler record 500 in the server console, then profiler saveJSON lag.json, and load the file in Chrome; Enhanced opens its traces in Perfetto UI.

What the FiveM resmon command shows

The Cfx.re Fact Sheet describes the resource monitor as a client tool to “diagnose which resource is taking a long time to execute”. It runs inside your game, so it measures the client scripts of the server you joined. Server-side scripts are not in that window; they need the profiler, covered further down. Both tools are built into FiveM itself, so they behave the same on Qbox, ESX, QBCore or a server with no framework: every running resource is listed by name.

The window is titled Resource Monitor. In the public FiveM source of November 17, 2026, its table has six columns:

ColumnWhat it measures
ResourceThe resource name. The first row, [Total CPU], covers all scripts together.
CPU msecTime the resource’s own code ran per tick, averaged over the last 64 ticks. A small line graph of recent ticks, scaled from 0 to 2.5 ms, sits beside the number.
Time %The resource’s share of all script time. On the [Total CPU] row it is script time as a share of the whole game frame.
CPU (inclusive)Like CPU msec, but it keeps counting while another resource runs nested inside this one, for example when it calls into that resource.
MemoryMemory reported by the resource’s script runtimes, refreshed at most every 500 ms. It is printed with a trailing +, or as ? when no figure is available.
StreamingStreaming memory of the game assets held by the resource’s script, or - when there are none.

The two CPU columns are coloured: green below 1 ms, shading through yellow, and fully red at 8 ms or more. Click a column header to sort: CPU msec, Time %, CPU (inclusive) and Memory sort highest first on the first click. The code has no sort for Streaming, so clicking that header leaves the rows in name order.

Averaging has one side effect worth knowing. A resource that does heavy work once every few seconds has that one long tick spread across 64 samples, so resmon shows a modest number while players still feel a stutter. The profiler records frames one by one and shows such spikes.

What counts as a high ms script in FiveM

No Cfx.re document sets a “good” millisecond target for a resource. When a reader in the official profiler thread asked “how many ms is ideal?” in January 2020, the reply was that it “Really depends on the complexity of the resource and what type of resource it is”. That reply estimated a floor of about 0.30 ms for C# resources, said Lua resources “can be as low as 0.01ms”, and kept most of the poster’s own resources below 0.05 ms. Those figures are one community member’s rule of thumb from 2020, not a Cfx.re limit.

The client itself draws a few lines you can rely on, because they are in its code:

SignalThreshold in the sourceWhere you see it
CPU msec colourGreen below 1 ms, red at 8 ms or moreresmon window
Resource time warningA resource averaging more than 6 ms per tickSmall box in the bottom-right corner while resmon runs

These are display thresholds, not performance targets. On the server, the clearest signal is the hitch warning, which the server thread hitch warning guide explains with its exact limits.

Fix “Access denied for command resmon” with developer mode

resmon is a developer command. The Console Commands page states that developer commands “require the client to run in a developer mode”, or they show an error such as Access denied for command resmon or Command strdbg is disabled in production mode.

The FiveM Legacy client makes this decision in its console code. It reads UpdateChannel from the [Game] section of CitizenFX.ini; a missing value counts as production. The game is in developer mode when that channel is neither production nor prod, or when the moo variable equals 31337. In production mode only a short allowlist of console commands runs: connect, quit, bind, rbind, unbind, disconnect, storymode, loadlevel, cl_drawFPS, cl_drawPerf, the profile_ volume and reticle settings, and the crosshair settings. Neither resmon nor profiler is on it, so the client prints:

Command resmon is disabled in production mode. See https://aka.cfx.re/prod-console for further information.

That short link leads to the developer-commands section of the Console Commands page. The shorter Access denied for command resmon. comes from the same permission check in the console code. In the current source, a production client prints the production-mode line in its place, and the generic line appears only when the check fails outside production mode. The docs and the Fact Sheet still quote the Access denied wording, and the docs give both errors the same fix: developer mode.

FiveM Legacy: enable developer mode on your client

  1. Add the launch argument. Add +set moo 31337 to the shortcut you start FiveM with. The docs say this works “On any update channel”.
  2. Or switch update channel. Running the client on a non-production channel such as Beta or Latest also enables developer mode. The docs warn that those channels “may be unstable and lead to issues including the game being unable to launch”.
  3. Restart FiveM, join the server and type resmon 1 in the F8 console.

FiveM for GTAV Enhanced: the server enables it

The Enhanced changes page says the +set moo 31337 argument “was removed” and that “Enabling devmode in the client now requires sv_devMode true to be set on the server side (in the server.cfg)”. Players cannot switch it on from their side any more: the development update says client development tools “will only be available on servers that explicitly enable developer mode”.

The July 15, 2026 development update adds two details. A server running sv_devmode is “limited to eight player slots to prevent production use”, and a server can instead grant developer mode to individual players “Inside deferrals.handover”. The docs do not describe that per-player method further, so the dependable route is a separate development server with sv_devMode true.

Check the permission with se_debug

se_debug true logs every permission check, which the docs call “Useful to see why some people do or don’t have access to certain commands”. It is a developer command too, so it only helps once developer mode is on. The docs’ example shows resmon allowed:

TEST ACL [system.console -> command.resmon] ACE [system.console command] -> ALLOW
TEST ACL [system.console -> command.resmon] -> ALLOW

How to use resmon step by step

  1. Turn on developer mode as described above for your platform.
  2. Join the server and press F8 to open the client console.
  3. Type resmon 1. resmon true works as well, which is the form the Fact Sheet uses. The console reads true and false in any letter case and treats any other number than 0 as on. Words it does not recognise count as off, so resmon on leaves the monitor closed.
  4. Sort by CPU msec. Click the column header and the slowest client resources move to the top.
  5. Reproduce the lag. Go where the FPS drops, open the menu that stutters, or wait for the job that freezes the screen, and watch which rows climb. Note the resource names.
  6. Close it with resmon 0. resmon is an archived setting, which the console code describes as “saved in user configuration”, and archived settings are written to %AppData%\CitizenFX\fivem.cfg. If you leave it on, it opens again on your next launch.

A server cannot switch resmon on for its players: the setting is flagged as a user preference, which “can’t be ‘setr’d from server->client”.

Players who are not in developer mode can still show cl_drawperf true. It is on the production allowlist and displays FPS, ping, packet loss, CPU and GPU usage and GPU temperature in the screen corner, which makes player lag reports easier to compare.

Is there a server-side resmon?

Not in the F8 window. For server scripts you have three tools:

  • The profiler, explained in the next section. It runs on Windows and Linux servers, on Legacy and Enhanced.
  • The server debug GUI, Legacy on Windows only. svgui “Opens or closes the server debug GUI”. The FiveM build script adds the GUI and the resmon code to the server only for Windows, so a Linux FXServer has neither. On Windows, FXServer registers a Tools/Performance/Resource Monitor entry in that GUI at startup, bound to the same resmon setting. The resmon code fences its client-only parts with IS_FXSERVER checks, so in a Windows FXServer it measures the server’s own resources. The GUI stays closed at startup because svgui_disable defaults to true, and the code skips it entirely when FXServer runs as a Windows service. After you close it, the console prints “You can reopen the server GUI using the command svgui”. The Enhanced docs list the server debug GUI as removed.
  • txAdmin’s thread chart on the dashboard shows tick durations for svMain, svSync and svNetwork, the server’s main, sync and network threads. The hitch warning guide shows how to read them next to the console warnings.

FiveM profiler record: capture a server profile

The profiler records frames. Each frame opens a scope named Resource Manager Tick, and inside it the profiler logs every resource tick and every event a resource handles, with start and end times. On the server, one frame is one tick of the main thread, svMain, whose timer is set to 1000 / 20, every 50 ms. So 500 frames cover about 25 seconds while the server keeps time, and longer when it hitches.

These are the subcommands in the Legacy source:

CommandWhat it doesConsole reply
profiler record <frames>Records that many frames, then stops by itselfStarted recording, later Stopped the recording
profiler record startRecords until you stop itStarted recording
profiler record stopEnds the recordingStopped the recording
profiler statusShows whether it is recording and how many frames are leftRecording: Yes (<frames>) or Recording: No, then Buffer: <events> events over <frames> frames
profiler saveJSON <file>Writes the capture as JSON that Chrome can loadSaving the recording as JSON to: <file>. then Save complete
profiler save <file>Writes a binary MessagePack file for profiler view <file>Saving the recording to: <file>. then Save complete
profiler view [file]Prepares the capture, or a saved binary file, for ChromeBuilding profile results (without a file)
profiler resource <name> <frames>Records like record, plus per-function detail for one resourceStarted recording
profiler helpLists the subcommandsOne line per subcommand

Record a server profile, step by step

  1. Update the server artifacts. The profiler guide asks for “the latest server artifacts” and an up-to-date client. The artifact update guide covers this.
  2. Record while the lag happens. A capture of an empty server rarely shows the problem. In the forum thread, one reply says testing “under load is much better to see where problems come from”.
  3. Start the recording. Type the first command below into the server console: the FXServer terminal, or the Live Console page in txAdmin. The profiler docs call 500 frames “A good starting point”.
  4. Check progress. profiler status prints Recording: Yes with the frames still to record. When the count runs out, the console prints Stopped the recording.
  5. Save the capture as JSON. The docs say the file goes “to the folder where your run.bat file lives”. On Linux, a forum reply says it lands where the server was launched from.
  6. Open it in Chrome. Copy the file to your computer, open a new Chrome tab, press Ctrl+Shift+I, select the Performance tab, right-click the panel and choose load profile.
profiler record 500
profiler status
profiler saveJSON lag.json

Keep captures near that size on a live server. Reports in the same thread, from 2019 and 2020, describe a server crash when viewing “a large profiler for example 1000 frames”, a game and Chrome crash above 2000 frames, and a 2GB file after a 50,000-sample capture. Another reply warns that viewing a capture “in a live environment with many players will cause a temporary hitch warning on the server”.

On a server, profiler view does not open Chrome; the docs say “you will need to copy the provided link to chrome”. In the source, the server prints that link only when its web_baseUrl variable exists, in this form:

You can view the recorded profile data at <DevTools URL>?loadTimelineFromURL=https://<web_baseUrl>/profileData.json in Chrome (or compatible).

While the Nucleus reverse proxy ran, web_baseUrl held the server’s *.users.cfx.re address, and forum examples of the link use it. Cfx moved the proxy’s retirement to June 30, 2026, and its March 30, 2026 update says web_baseUrl “will return the connectEndpoint directly once Nucleus is deprecated, as will the server profiler”. The same post says HTTPS must be handled by the server owner, for example with a reverse proxy, and the printed link starts with https://. If no link appears, or it does not load, use profiler saveJSON instead. Forum replies also opened http://<server-ip>:30120/profileData.json directly, 30120 being the default port, and saved the page as a .json file.

Protect profileData.json with sv_profileDataToken

After a profiler view, the server keeps that profile in memory and serves it at /profileData.json on its HTTP port, with Access-Control-Allow-Origin: *. Unless sv_profileDataToken is set, anyone who can reach the port can download it, and a capture names your resources, their events, and the files and lines of their threads.

Set a long secret in server.cfg:

set sv_profileDataToken "replace-with-a-long-random-string"

With a token set, a request without the matching ?token= gets 401 and Unauthorized, and the link that profiler view prints carries the token for you. Before any profiler view, the endpoint answers 404 with []. sv_profileDataToken is defined in the FXServer source but does not appear in the server-commands reference.

Profile one resource in detail

profiler resource <name> <frames> records like profiler record and also attaches the resource’s script runtime to the profiler. The source calls it the “Extended profiler API for a single resource (by name) or all: *”. For a Lua resource, every function entry and exit becomes its own scope named after its source file, with periodic memory figures. Use it when a capture shows one resource with a long tick and you need to know which function inside it is slow. Both arguments are needed: with the frame count left out, the command does nothing. profiler resource stop ends it.

Capture a client profile for FPS drops

The same commands work in the F8 console once developer mode is on; a production client answers Command profiler is disabled in production mode. On the client, profiler view opens Chrome and loads the capture by itself. A saved file goes to the client’s citizen:/ folder, which a forum reply locates at %localappdata%\FiveM\FiveM.app\citizen.

How to read a FiveM profile in Chrome

The docs describe the screen from the top down: the recording timestamp, an FPS graph in green, and a CPU time graph in yellow, which they call the important one. Peaks in it “correlate to frame drops / micro stuttering or server hitches”, and a server hitch shows as a sudden spike that exceeds normal frames.

  1. Zoom in on a spike. Scrolling on the time bar zooms the whole display around your cursor.
  2. Read the frame. A zoomed frame shows the timestamp, the total frame time in green and the script threads that ran in it. Hovering the frame time shows the average FPS.
  3. Open the resource tick. Zoom on the yellow resource tick event. Hovering an event shows how many milliseconds it took and the file and line numbers of the thread. The docs’ own example points at a client.lua file, lines 29 to 34.

The entries are named by the profiler’s code:

Entry in the timelineWhat it is
Resource Manager TickOne frame of resource work
tick (<resource>)The resource’s scheduled work, where its threads run
event:<eventName> (<resource>)The resource handling one event
Thread or function namesWork inside a resource; every Lua function with profiler resource

A long event: block is time spent handling one event, and many blocks for the same event in one frame mean it fires very often. A long tick (...) block is time spent in the resource’s threads. The Fact Sheet names two things that can cause hitches: SQL queries “that take a long time to execute” and “unoptimized loops that end up halting the script execution”.

Chrome labels the tracks as if they came from a web browser, with CrBrowserMain and CrRendererMain. That is how FiveM packs the data for Chrome’s tools, not an error.

FiveM for GTAV Enhanced: what changes

The source quoted above is the public Legacy code. For Enhanced, which entered early access on July 21, 2026, the official docs and the development update state these differences:

  • Developer mode comes from the server. +set moo 31337 was removed; set sv_devMode true in server.cfg, with the eight-slot limit described above.
  • The profiler has a new backend. Cfx “replaced the legacy profiler backend with Perfetto”. The update lists the commands as profiler record <duration> and profiler save <filename>.json, says traces are saved to the profiler/ folder inside the Enhanced installation directory, and tells you to open the JSON file in Perfetto UI.
  • Two new client dev tools. cl_drawResTimeGraphs shows “the Resource Time Graphs dev tool” and cl_drawResTimeWarnings shows “the Resource Time Warnings dev tool”. Both are Enhanced-only and default to false. The Console Commands page does not say whether they need developer mode; the development update says client development tools are only available on servers that enable it.
  • No server debug GUI. svgui is gone on the Cfx Server.
  • Tools are being rebuilt. The update says the Legacy developer tools “are being reimplemented for the Enhanced client” and that not everything is final yet. The Console Commands page still lists resmon without marking it Legacy-only.

The development update and the Legacy source do not line up. The update says “The commands remain the same”, yet it calls the record argument a duration without giving a unit, while the Legacy record takes a frame count. It also shows profiler save writing a .json file, where the Legacy save writes a binary file and JSON comes from saveJSON. On Enhanced, follow the update’s syntax and check the console’s reply.

Other console tools that help with lag

CommandWhat the docs say it showsDeveloper mode
cl_drawperf trueFPS, ping, packet loss, CPU and GPU usage, GPU temperatureNot needed
netgraph trueReal-time ping, packets and bytes in and outNeeded
neteventlog trueEvery network event with its direction, name and sizeNeeded
strmem trueStreaming memory used by specific assets, plus an overviewNeeded

neteventlog lets you see an event that fires far too often, with the size of each send. strmem lists the streaming memory that each streamed asset uses.

What to do with the resource you found

  1. Confirm it on a test server. stop <resource> stops it; ensure <resource> restarts it if it was started, or starts it if it was not. If the spike disappears with the resource stopped, you have your culprit.
  2. Look for the causes the Fact Sheet names. Slow SQL queries and unoptimized loops that halt script execution.
  3. Update it or hand the capture to its author. The profiler guide says it “will not explain how to fix these issues, simply how to identify where they are”. Send the saved .json and the time the lag happened. For a clean reinstall, see how to install FiveM scripts; FiveCrate’s scripts category lists the studio’s own resources.

Troubleshooting

“Access denied for command resmon”

The docs give this message the same cause as the production-mode line: developer mode is off. On Legacy, add +set moo 31337 to the launch shortcut or move to the Beta or Latest channel, then restart. On Enhanced, the server must run sv_devMode true.

“Command profiler is disabled in production mode”

The same check blocks the profiler in the F8 console; a forum user posted this exact reply in 2024. Enable developer mode as above. For server lag, type the profiler commands into the server console instead.

resmon 1 does nothing or the window does not open

  • Typed resmon alone. Typing a variable’s name prints its value, as the docs’ set example shows; it does not open the window. Add 1 or true.
  • Typed a word. Only true, false and numbers are read; resmon on counts as off.
  • No reply at all. Check for the production-mode message first.

“Malformed timeline data: Unknown JSON format”

Chrome got data it cannot read. Replies in the forum thread tie it to three situations:

  • A binary file from profiler save. One reply explains that file is meant to be loaded back into FiveM on another client or server and viewed there, “not load the .bin file in the chrome profiler”. Save with profiler saveJSON instead.
  • A server link that returned no profile. Users whose profiler view link failed opened /profileData.json directly and saved the page as a .json file, as described above. The docs also say to keep the server running when you view without saving first.
  • Another browser. The docs ask for Google Chrome, and one reply says even other Chromium-based browsers give this error.

The console shows Building profile results and then nothing when web_baseUrl is not set. Use profiler saveJSON and load the file in Chrome. If a direct /profileData.json request answers Unauthorized, add ?token= with your sv_profileDataToken value.

“profiler start not found”

profiler start is not a subcommand, so the console answers “profiler start not found. See profiler help for available commands”. Use profiler record start, or profiler record 500.

“A recording is already taking place” or “Cannot view: profiler is active.”

A recording is still running, perhaps one started with profiler record start. End it with profiler record stop, then save or view.

The server froze while saving or viewing a profile

The capture was too large for a live server. The forum reports above describe crashes when viewing 1000 or more frames. The reply to the 1000-frame report says “It’s not done async” and advises “Keep it around 500 frames”, the size the profiler docs also suggest. Another reply warns that viewing a capture on a live server with many players causes “a temporary hitch warning”.

“Resource time warning” and “Please contact the server owner”

This box comes from the resource monitor: it appears when a client resource averages more than 6 ms per tick, lists each one in the form <resource> is taking <ms> ms (or -<fps> FPS @ 60 Hz), and ends with “Please contact the server owner to resolve this issue.” In the public Legacy source, the monitor behind it only runs while resmon is on, or when the game runs inside the FxDK SDK, so you normally see it with resmon open. It stays for about 20 seconds and returns after 10 minutes if the resource is still slow.

A long frame with no resource under it

The profiler only attributes time to resources, events and scopes inside the Resource Manager Tick. In 2019, the author of the profiler docs answered this exact question with “I’m not 100% sure what causes that” and a guess at garbage collection. On a server, compare the capture with the hitch warnings and txAdmin’s charts, as the hitch warning guide describes. If resmon and the profiler both look clean while the game stutters, check streamed assets next with strmem, then the oversized assets warning guide and the texture loss guide.

Next Steps

Official documentation and repository references