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
Inconfig.lua
:
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.
6. Manage resource order
Ensure dependencies are started before scripts:7. Monitor server performance
- Use built-in RedM profiling tools.
- Identify and address high CPU or memory usage early.