Skip to content
This repository was archived by the owner on Oct 17, 2022. It is now read-only.

Commit 0fcf72a

Browse files
authored
Documentation for background indexing (#439)
1 parent 99f9741 commit 0fcf72a

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

src/config/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Configuration
2626
http
2727
auth
2828
compaction
29+
indexbuilds
2930
logging
3031
replicator
3132
query-servers

src/config/indexbuilds.rst

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
.. Licensed under the Apache License, Version 2.0 (the "License"); you may not
2+
.. use this file except in compliance with the License. You may obtain a copy of
3+
.. the License at
4+
..
5+
.. http://www.apache.org/licenses/LICENSE-2.0
6+
..
7+
.. Unless required by applicable law or agreed to in writing, software
8+
.. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9+
.. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10+
.. License for the specific language governing permissions and limitations under
11+
.. the License.
12+
13+
.. default-domain:: config
14+
.. highlight:: ini
15+
16+
===================
17+
Background Indexing
18+
===================
19+
20+
Secondary indexes in CouchDB are not updated during document write operations. In order to
21+
avoid high latencies when reading indexes following a large block of writes, CouchDB
22+
automatically kicks off background jobs to keep secondary indexes "warm". The daemon
23+
responsible for this process is internally known as "ken" and can be configured using the
24+
following settings.
25+
26+
.. _config/index_builds:
27+
28+
.. config:section:: ken :: Background Index Builds
29+
30+
.. config:option:: batch_channels :: Steady-state build concurrency
31+
32+
This setting controls the number of background view builds that can be running in
33+
parallel at any given time. The default is 20.
34+
35+
.. config:option:: incremental_channels :: Additional slots for short jobs
36+
37+
It is possible for all the slots in the normal build system to be occupied by
38+
long-running index rebuilds (e.g. if new design documents are posted to several
39+
databases simultaneously). In order to avoid already-built indexes from falling
40+
behind when this occurs, CouchDB will allow for a number of short background
41+
indexing jobs to run even when all slots are full. This setting controls how many
42+
additional short jobs are allowed to run concurrently with the main jobs. The
43+
default is 80.
44+
45+
.. config:option:: max_incremental_updates :: Threshold defining a job as short
46+
47+
CouchDB estimates whether an indexing job is "incremental" or not by looking at
48+
the difference in sequence numbers between the current index and the main
49+
database. If the difference is larger than the threshold defined here the
50+
background job will only be allowed to run in the main queue. Defaults to 1000.
51+
52+
.. config:section:: ken.ignore :: Auto-Indexing Blacklist
53+
54+
Entries in this configuration section can be used to tell the background indexer to skip
55+
over specific database shard files. The key must be the exact name of the shard with the
56+
``.couch`` suffix omitted, for example:
57+
58+
.. code-block:: ini
59+
60+
[ken.ignore]
61+
shards/00000000-1fffffff/mydb.1567719095 = true

0 commit comments

Comments
 (0)