# Performance

{% hint style="danger" %}
Do NOT change anything in this file unless you **REALLY** know what you are doing.

Changing these values can lead to performance issues.
{% endhint %}

This file contains performance settings for the script that should be changed only if you are having issues with performance or if we tell you to do so in a support ticket.

## Performance

* `SendToServerInterval` - How often (in minutes) the client sends changes to the server. Default is `1` minute.
* `SaveToDatabase` - How often (in minutes) the server saves accumulated data to the database. Default is `1` minute.
* `MaxUpdatesPerIteration`
  * How many player updated will be handled in one iteration
  * Only players that got their stats updated will be handled
  * The players that are over the limit will be handled in the next iteration
  * Default is `500` players, if you have more players, you can increase this number if you are having trouble.
* `MonitorTiming`
  * `MONEY` - How often (in seconds) the script will check for money changes. Default is `10` seconds.
  * `DISTANCE_SAVE` - How often (in seconds) the script will save distance traveled. Default is `10` seconds.
  * `SAVE_TO_KVP` - How often (in seconds) the script will save data to KVP. Default is `60` seconds.
  * `CHECK_FAVORITE_CHANGE` - How often (in seconds) the script will check for favorite vehicle/weapon change. Default is `60` seconds.
  * `SAVE_SHOTS` - How often (in seconds) the script will save shots fired. Default is `10` seconds.
  * `TIME_PLAYED_SAVE` - How often (in minutes) the script will save time played. Default is `1` minute.
  * `CHECK_MONITOR_STATES` - How often (in minutes) the script will check what stat monitors should be running depending on the stat type enabled state that it measures. Default is `5` seconds.
  * `CALCULATE_SERVER_STATS` - How often (in minutes) the script will calculate server stats. Default is `15` minute.

## Limits

Config.Limits is used to set limits to certain parts of the script.

* `MAX_VEHICLE_DISTANCE` - maximum distance in meters a player can approximately take in 10 sec to prevent counting distance by teleport, default `1000`
* `MAX_WALK_DISTANCE` - maximum distance in meters a player can approximately take in 10 sec to prevent counting distance by teleport, default `100`
* `MAX_ABOVE_GROUND` - maximum height in meters a player can be above ground to count speed in land vehicle (prevent counting speed while falling), default `5`
* `MAX_FAVORITE_VEHICLES_LENGTH` - maximum number of favorite vehicles to save, default `100`
* `MAX_FAVORITE_WEAPONS_LENGTH` - maximum number of favorite weapons to save, default `100`
* `MIN_DISTANCE_TO_HANDLE_IN_FAVORITES` - minimum distance to count with in favorites table, anything less will not get compared, default `50`
* `MIN_SHOTS_TO_HANDLE_IN_FAVORITES` - minimum shots to count with in favorites table, anything less will not get compared, default `5`
* `ADMIN_TOGGLE_STAT_TYPE_COOLDOWN_MINS` - cooldown in minutes for toggling stat types in admin panel, default `1` minute
* `ADMIN_REQUEST_STATS_COOLDOWN_SECS` - cooldown in seconds for requesting stats of another player, default `10` seconds


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.rcore.cz/paid-resources/rcore_stats/configs/config_performance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
