3.7. QuickJS — Apache CouchDB® 3.4 Documentation

# 3.7. QuickJS

Configure QuickJS Javascript Engine.

QuickJS is a new Javascript Engine installed alongside the default Spidermonkey engine. It’s disabled by default, but may be enabled via configuration settings.

The configuration toggle to enable and disable QuickJS by default is in couchdb `js_engine` section.

To help evaluate design doc compatibility, without the penalty of resetting all the views on a cluster, there is a scanner plugin, which will traverse databases and design docs, compile and then execute some of the view functions using both engines and report incompatibilities.

Added in version 3.4.

## 3.7.1. QuickJS Options

[quickjs]
  memory_limit_bytes

    Set QuickJS memory limit in bytes. The default is `undefined` and the built-in C default of 64MB is used.

        [quickjs]
        memory_limit_bytes = 67108864

[couch_quickjs_scanner_plugin]

Enable QuickJS Scanner plugin in couch_scanner_plugins `couch_scanner_plugins` section.

> max_ddocs

>   Limit the number of design docs processed per database.

>       [couch_quickjs_scanner_plugin]
>       max_ddocs = 100

> max_shards

>   Limit the number of shards processed per database.

>       [couch_quickjs_scanner_plugin]
>       max_shards = 4

> max_docs

>   Limit the number of documents processed per database. These are the max number of documents sent to the design doc functions.

>       [couch_quickjs_scanner_plugin]
>       max_docs = 1000

> max_step

>   Limit the maximum step size when processing docs. Given that total number of documents in a shard as N, if the max_docs is M, then the step S = N / M. Then only every S documents will be sampled and processed.

>       [couch_quickjs_scanner_plugin]
>       max_step = 1000

> max_batch_items

>   Maximum document batch size to gather before feeding them through each design doc on both QuickJS and Spidermonkey engines and compare the results.

>       [couch_quickjs_scanner_plugin]
>       max_batch_items = 100

> max_batch_size

>   Maximum memory usage for a document batch size.

>       [couch_quickjs_scanner_plugin]
>       max_batch_size = 16777216

> after

>   A common scanner setting to configure when to execute the plugin after it’s enabled. By default it’s `restart`, so the plugin would start running after a node restart:

>       [couch_quickjs_scanner_plugin]
>       after = restart

> repeat

>   A common scanner setting to configure when to execute the plugin after it’s enabled. By default it’s `restart`, so the plugin would start running after a node restart:

>       [couch_quickjs_scanner_plugin]
>       repeat = restart