Index Throttling delays indexing operations by a time interval of your choice.
Indexing is triggered normally when items are added or modified, but RavenDB suspends
index procession by the set interval.
The gaps in indexing activity and the procession of
can reduce overall indexing CPU utilization.
Indexing can be throttled server-wide, per-database, and per-index.
Index throttling applies to the procession of existing indexes. New indexes are processed sequentially without delay.
Indexing a rapidly modified group of items (e.g. a time series, a group of counters,
or a patched collection) can preoccupy RavenDB with lengthy consecutive indexing of
small batches of items.
Throttles Index Performance View
The Indexing Performance view shown above demonstrates the procession of a throttled index
along the timeline, with a 1500 Milliseconds gap between consecutive batches.
Throttling offers indexing-free time gaps that the database can use for other
tasks and the procession of larger batches when indexing does take place.
Throttled indexes are kept stale
as long as their procession is incomplete.
They are therefore expected to remain stale longer than indexes that are processed sequentially.
Throttling and Batches
The delay in index procession increases the size of Item batches
that are processed during indexing intervals.
In special cases, throttled indexes' batches are processed without delay.
The batch following a batch that cannot be processed for known reasons, will be processed
Accumulated data (collected due to batch size configuration, for example) whose procession
requires multiple batches, will be processed with no delay between batches.
Setting Index Throttling
Server-Wide Index Throttling
Index Throttling can be set server-wide using a designated configuration option.
Setting the server-wide configuration option will apply to all databases on a given node.
Set the index throttling time interval in Milliseconds using the Indexing.Throttling.TimeIntervalInMs configuration option, e.g.: "Indexing.Throttling.TimeIntervalInMs": "5000"
Index Throttling Per-Database
Enable or disable index throttling for a specific database using the designated database configuration key.
Setting this property overrides the
Database Configuration Keys
Open Settings > Database Settings view.
Filter Keys - Enter a search string to locate the configuration key.
Edit - Click to edit values (see next image for details).
Configuration Key - Indexing.Throttling.TimeIntervalInMs - Index Throttling configuration key.
Effective Value - The current configuration.
Origin - The origin of the current configuration.
Can be - Default | Database
Override - Toggle to override the server-wide configuration.
Edit Value - Enter a new time in Milliseconds, or leave empty for null (no throttling).
Set Default - Click 'Set Default' to select the server-wide default value.
Save - Apply changes.
An edited configuration key's value will become effective only after the database is reloaded.
Index Throttling in an Index Definition
Setting throttling in an index definition overrides server-wide
and database settings configuration.
Set throttling for a specific index using the Indexing.ThrottlingTimeInterval property.
var index = new Orders_ByOrder
[RavenConfiguration.GetKey(x => x.Indexing.ThrottlingTimeInterval)] = "2000",
The batch size can be left for RavenDB to decide, or you can set it yourself using
the MapBatchSize property.