Skip to main content
This guide provides recommendations to help you run Dietrich Development RedM scripts efficiently without impacting overall server performance.
These tips focus on script-level optimizations. For general RedM performance tuning, refer to your framework or hosting provider’s documentation.

1. Keep scripts up-to-date

  • Always run the latest version of our scripts for bug fixes and optimizations.
  • Check our Changelogs regularly.

2. Disable debug mode

In config.lua:
Config.DebugMode = false
Disabling debug mode removes unnecessary console output and processing.

3. Optimize update loops

  • Use longer update intervals (Citizen.Wait) where possible.
  • Avoid per-frame calculations for non-critical features.

4. Reduce unnecessary events

  • Disable features you don’t need in config.lua.
  • Avoid triggering the same server event multiple times in a short period.

5. Minimize database queries

  • Use caching to store frequently accessed data.
  • Batch database operations when possible.
Example:
local players = MySQL.query.await('SELECT id, name FROM players')
Instead of running this query for each player individually.

6. Manage resource order

Ensure dependencies are started before scripts:
ensure vorp_core
ensure my_script
This prevents repeated restarts and wasted processing.

7. Monitor server performance

  • Use built-in RedM profiling tools.
  • Identify and address high CPU or memory usage early.

8. Remove unused resources

Disable or delete scripts you no longer use to free up server resources.

Next steps

I