Performance Tuning
CXA Anticheat runs on your server and on every player's PC, so like every resource it costs some performance. This page shows which settings cost the most, how CXA keeps everything else cheap and how you measure the cost on your own server. We do not publish benchmark numbers, because the real cost depends on your player count, your scripts and your settings, so the numbers that count are the ones you measure yourself.
Measure Before You Change Anything
If you suspect a performance problem, measure first (see Measuring on Your Server). Turning settings off at random can remove protection without fixing the real cause.
How CXA Keeps the Cost Low
These choices are built into the anticheat and need no setup:
- Active bans are loaded into memory when CXA starts, so connection checks never query the database.
- Client checks run on the player's PC and cost client FPS only. The server only receives a report when a check finds something.
- All client checks share one loop that wakes every 100 ms. Each check only runs at its own interval.
- Reports from a client are rate limited to 20 per player every 10 seconds, so a modified client cannot flood the server.
- The entity blacklist and the blacklisted weapon damage check each cost a single table lookup per event.
- The server movement check spreads players over several ticks instead of checking everyone at once.
- Large jobs, such as decoding a screenshot or scanning attached objects, pause briefly between steps so they do not freeze the server thread.
- Webhook messages wait in a queue and are sent one at a time, every 1200 ms by default, so Discord rate limits never block the server.
- Repeated
logdetections of the same player are skipped for 10 seconds. - Bypass results are cached for 60 seconds and staff roles for 30 seconds, so ACE and framework calls stay rare.
- VPN check results are cached per IP for 120 minutes.
- With oxmysql, ban writes run in the background. With JSON storage, changes are collected and the file is written at most once every 2 seconds.
- The live map and live screens send nothing while nobody is watching them in the panel.
- Event Guard counts event calls in memory inside each guarded resource and reads its settings from CXA once a minute.
What [PERF] Means
Some settings are marked [PERF]. In config.lua you see it in the comment next to the setting. In the panel, the setting shows an amber PERF badge with a short explanation below it.
According to config.lua, a [PERF] setting "can raise server resmon or cause hitch warnings on high population servers (150+)". It does not mean the setting is broken or should stay off. It means the setting does more work than the others, so turn it on when you need it and check the cost on your server.
Settings Marked [PERF]
All of these are under Configuration in the panel.
| Setting | Panel location | Key | Default | Why it costs |
|---|---|---|---|---|
| Storage | Ban system → Ban system | Ban.Storage | oxmysql | json rewrites the whole file on every change. Avoid it with thousands of bans. |
| VPN / proxy check | Connection → VPN / proxy check | Connection.VpnCheck.Enabled | Off | One HTTP request per new IP. Results are cached, but joins get slightly slower. |
| Network check on connect | Network & trust → Network check on connect | NetworkCheck.Enabled | On | One HTTPS request per joining player. Adds up to the timeout (3000 ms) to the join. |
| Max queue size | Logs → Logging | Logs.MaxQueueSize | 200 | Webhook messages wait in this queue. When it is full, the oldest messages are dropped. |
| Screenshots | System → Screenshots | Screenshot.Enabled | Off | Each screenshot is decoded and uploaded by the server, which costs CPU and bandwidth. |
| Cleanup on detection | Server detections → Entity spam | ServerDetections.EntitySpam.CleanupOnDetection | Off | Loops over every server entity once to delete the spammer's entities. |
| God mode (server heuristic) | Server detections → God mode (server heuristic) | ServerDetections.GodModeHeuristic.Enabled | On | Starts one short timer for every hit of 20 damage or more on a player. |
| Server movement check | Server detections → Server movement check | ServerDetections.Movement.Enabled | Off | Reads every player's position. Keep Players per tick (default 20) low on big servers. |
| Objects attached to players | Server detections → Objects attached to players | ServerDetections.AttachedObjects.Interval | 5000 ms | Scans every networked object and vehicle at each interval. Keep it at 5000 ms or more on big servers. |
| Frames per second | Network & rules → Web monitoring | Monitoring.Fps | 1 | Every frame is a screenshot on the watched player's PC. Only runs while someone watches. |
Measuring on Your Server
resmon (Client)
resmon is FiveM's resource monitor. It shows how much CPU time and memory each resource uses on your own game client.
- Join your server and play normally for at least a minute. CXA starts its client checks 15 seconds after you join, and the first gameplay data scan runs 20 seconds after you spawn.
- Press
F8to open the console. - Type
resmon 1and press Enter. - Find
cxa-anticheatin the list and watch it for a while instead of reading a single frame. - Type
resmon 0to close it.
resmon Adds Its Own Load
Keeping resmon open costs frame time itself, so values can look higher while it is open. Compare resources against each other on the same client, and close resmon when you are done.
FiveM Profiler (Server and Client)
The FiveM profiler records exactly where time is spent, frame by frame. Use it in the server console for the server side and in the F8 console for the client side.
# Record the next 500 frames
profiler record 500
# Check whether the recording is still running
profiler status
# Show the recording in a timeline viewer
profiler view
# Save the recording to a file
profiler saveJSON cxa-profile.jsonYou can also start and stop a recording by hand with profiler record start and profiler record stop. On a server, profiler view gives you a link that opens the recording in a Chrome DevTools timeline, so use Chrome or another Chromium-based browser.
To get a summary instead of a timeline, drop the saved file on the Profiler analyzer on the tools page. It reads both formats: the JSON from profiler saveJSON <file>.json and FiveM's own binary file from profiler save <file>. It lists the heaviest resources and threads and every call that took longer than one frame.
Reading the Results
- Record while your server is busy, at your usual peak time. A recording on an empty server tells you very little.
- Compare
cxa-anticheatwith your other resources, not with zero. Every resource costs something. - Spikes at a fixed rhythm usually come from a timed scan, for example the attached objects scan every 5 seconds.
- Spikes during fights, explosions or many new vehicles usually come from event-based checks. During an attack, CXA does more work because it is blocking the attack.
- Event Guard runs inside each guarded resource, so its time shows up under that resource's name, not under
cxa-anticheat. - To test a single [PERF] setting, record once, change only that setting, wait a minute and record again. Saving in the panel restarts CXA a few seconds later.
Reporting a Performance Issue
If CXA costs more than you expect, open a ticket on your dashboard. Include:
- Your license number from the panel, for example
#1024(never your full license key) - The player count and the time when it happened
- Your server artifact build and your framework
- The exact console lines, copied as text, for example hitch warnings or
[CXA]warnings - Which [PERF] settings are on, and what you changed shortly before the problem started
- Screenshots of resmon from a client
- A profiler recording saved with
profiler saveJSON, if our team asks for one
Recommendations
Recommended:
- Keep oxmysql as the ban storage, especially once you have many bans.
- Keep the default intervals unless a measurement shows a problem.
- On big servers, keep Players per tick low for the server movement check and the attached objects scan interval at 5000 ms or more.
- Keep live screen frames per second at the default and watch only the players you need.
Avoid:
- Turning on every [PERF] setting at once. Turn them on one by one and measure.
- Judging performance from resmon right after joining or from a single frame.
- Turning detections off to save performance without measuring first. Only the settings in the table above are marked as costly.
Related Features
Screenshots
- Screenshots are a [PERF] setting because the server decodes and uploads each image. See Screenshots.
Live Screens
- Each watched player sends one screenshot per frame. See Live Screens.
Join Screening
- The VPN check and the network check on connect add time to joining, not to the running server. See Join Screening.
Logging & Discord
- The webhook queue and its size are set in the logging settings. See Logging & Discord.
Common Problems
Hitch Warnings After Turning On a [PERF] Setting
What you see: The server console prints hitch warnings after you enabled a [PERF] setting.
How to fix it:
- Turn that setting off again and check whether the warnings stop.
- If you need the setting, raise its interval or lower its load, for example fewer players per tick for the server movement check.
- Record a profile with the setting on and off and send both to us in a ticket.
Players Take Longer to Join
What you see: Joining takes noticeably longer than before.
How to fix it:
- The network check on connect waits up to its timeout (3000 ms) for the CXA network. Keep Let players in when unreachable on, so a slow answer never blocks a join.
- If the VPN check is on, every new IP needs one request. Keep the cache time high.
- Check your other join resources too, for example queue or whitelist scripts.
Discord Logs Arrive Late or Some Are Missing
What you see: Webhook messages arrive minutes later, or some never arrive.
How to fix it:
- Messages are sent one at a time to respect Discord rate limits. During a busy moment, the queue takes a while to empty.
- When the queue is full, the oldest messages are dropped. The panel's Detections tab still has every detection.
- If messages are dropped often, raise Max queue size a little. A bigger queue also takes longer to empty.
cxa-anticheat Shows High Values in resmon
What you see: resmon shows cxa-anticheat higher than you expect.
How to fix it:
- Wait at least a minute after joining, then watch the value over time instead of reading a single frame.
- Close other overlays and measure again.
- If the value stays high, note which situations cause it, for example driving or fighting, and send screenshots in a ticket.
© 2026 CodeXart Studios · CXA Anticheat