Limits
Limits are intended to restrict the resources that users can utilize for their queries.
Limiting Metrics
Limits for queries are configured separately for users and roles. Limits for commands are configured in global settings (_cluster/settings
).
Limits at Query Start
- Allowed time interval:
allowed_dt_start
andallowed_dt_end
- List of available commands:
allowed_commands
- Amount of requested data:
max_qsize
Limits During Query Execution
- Number of payload documents:
max_payload_row_count
- Payload size in bytes:
max_payload_size
- Amount of memory allocated per thread in bytes:
max_thread_ram_usage
- Maximum query execution time in seconds:
max_search_running_time
Limits for Individual Commands
- Number of documents returned by subqueries
- Number of values processed by the
list
function of thestats
command - Number of documents sorted by the
sort
command
System Limit Settings
Limit settings are stored in _cluster/settings
in the sme.core
dictionary. Below is a table with the limit settings and their default values.
Name | Description | Default Value |
---|---|---|
enable_limits | Enable/Disable Limiting. | true |
check_base_limit | Creates an index with limits if it does not exist. Creates a basic limit if it is missing in the index with limits. | true |
limits.index_name | Name of the index where limits are stored. | .sm_sme_limits_user |
max_subsearch_hits_count | Maximum number of documents returned by a subquery. | 50000 |
list_limit | Maximum number of values returned by the list function of the stats command. | 100 |
sort_limit | Maximum number of documents sorted by the sort command. | 10000 |
# Configuring User and Role Limits
Each user limit is checked sequentially. First, the user's own limit is checked. If it is not specified, the limit of the roles that the user has is checked. If multiple roles have the limit specified, the best one is chosen. If the user's roles also do not have the limit specified, the basic limit is used.
Limits are configured in Settings - Management - Limits
. Here, you can configure the basic limit, limits for specific roles, or users.
Example Configuration
The following limits are assigned to a user:
Name | Value |
---|---|
max_qsize | 500 |
allowed_commands | source stats eval |
Additionally, this user has the roles developer
and user
. The limits for the developer
role are:
Name | Value |
---|---|
max_search_running_time | 500 |
allowed_commands | source streamstats eventstats |
Limits for the user
role:
Name | Value |
---|---|
max_qsize | 1000 |
allowed_dt_start | now-3w |
After combining all types of limits, the resulting configuration will be:
Name | Value | Limit Type |
---|---|---|
max_qsize | 500 | Personal |
allowed_dt_start | now-3w | Personal |
max_search_running_time | 500 | From role developer |
allowed_commands | source stats eval streamstats eventstats | Combined Personal Limit and developer role |
allowed_dt_end | Default | Basic |
max_payload_row_count | Default | Basic |
max_payload_size | Default | Basic |
max_command_ram_usage | Default | Basic |