Skip to main content
Version: 5.0

Limits

Limits are intended to restrict the resources that users can utilize for their queries.

Limiting Metrics

info

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 and allowed_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 the stats 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.

NameDescriptionDefault Value
enable_limitsEnable/Disable Limiting.true
check_base_limitCreates 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_nameName of the index where limits are stored..sm_sme_limits_user
max_subsearch_hits_countMaximum number of documents returned by a subquery.50000
list_limitMaximum number of values returned by the list function of the stats command.100
sort_limitMaximum number of documents sorted by the sort command.10000

# Configuring User and Role Limits

Order of Limit Checks for a User

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:

NameValue
max_qsize500
allowed_commandssource
stats
eval

Additionally, this user has the roles developer and user. The limits for the developer role are:

NameValue
max_search_running_time500
allowed_commandssource
streamstats
eventstats

Limits for the user role:

NameValue
max_qsize1000
allowed_dt_startnow-3w

After combining all types of limits, the resulting configuration will be:

NameValueLimit Type
max_qsize500Personal
allowed_dt_startnow-3wPersonal
max_search_running_time500From role developer
allowed_commandssource
stats
eval
streamstats
eventstats
Combined Personal Limit and developer role
allowed_dt_endDefaultBasic
max_payload_row_countDefaultBasic
max_payload_sizeDefaultBasic
max_command_ram_usageDefaultBasic