3.13. Miscellaneous Parameters

3.13.1. Configuration of Attachment Storage

[attachments]

  • compression_level

    Defines zlib compression level for the attachments from 1 (lowest, fastest) to 9 (highest, slowest). A value of 0 disables compression:

    1. [attachments]
    2. compression_level = 8
  • compressible_types

    Since compression is ineffective for some types of files, it is possible to let CouchDB compress only some types of attachments, specified by their MIME type:

    1. [attachments]
    2. compressible_types = text/*, application/javascript, application/json, application/xml

3.13.2. Statistic Calculation

[stats]

  • interval

    Interval between gathering statistics in seconds:

    1. [stats]
    2. interval = 10

3.13.3. UUIDs Configuration

[uuids]

  • algorithm

    Changed in version 1.3: Added utc_id algorithm.

    CouchDB provides various algorithms to generate the UUID values that are used for document _id’s by default:

    1. [uuids]
    2. algorithm = sequential

    Available algorithms:

    • random: 128 bits of random awesome. All awesome, all the time:

      1. {
      2. "uuids": [
      3. "5fcbbf2cb171b1d5c3bc6df3d4affb32",
      4. "9115e0942372a87a977f1caf30b2ac29",
      5. "3840b51b0b81b46cab99384d5cd106e3",
      6. "b848dbdeb422164babf2705ac18173e1",
      7. "b7a8566af7e0fc02404bb676b47c3bf7",
      8. "a006879afdcae324d70e925c420c860d",
      9. "5f7716ee487cc4083545d4ca02cd45d4",
      10. "35fdd1c8346c22ccc43cc45cd632e6d6",
      11. "97bbdb4a1c7166682dc026e1ac97a64c",
      12. "eb242b506a6ae330bda6969bb2677079"
      13. ]
      14. }
    • sequential: Monotonically increasing ids with random increments. The first 26 hex characters are random, the last 6 increment in random amounts until an overflow occurs. On overflow, the random prefix is regenerated and the process starts over.

      1. {
      2. "uuids": [
      3. "4e17c12963f4bee0e6ec90da54804894",
      4. "4e17c12963f4bee0e6ec90da5480512f",
      5. "4e17c12963f4bee0e6ec90da54805c25",
      6. "4e17c12963f4bee0e6ec90da54806ba1",
      7. "4e17c12963f4bee0e6ec90da548072b3",
      8. "4e17c12963f4bee0e6ec90da54807609",
      9. "4e17c12963f4bee0e6ec90da54807718",
      10. "4e17c12963f4bee0e6ec90da54807754",
      11. "4e17c12963f4bee0e6ec90da54807e5d",
      12. "4e17c12963f4bee0e6ec90da54808d28"
      13. ]
      14. }
    • utc_random: The time since Jan 1, 1970 UTC, in microseconds. The first 14 characters are the time in hex. The last 18 are random.

      1. {
      2. "uuids": [
      3. "04dd32b3af699659b6db9486a9c58c62",
      4. "04dd32b3af69bb1c2ac7ebfee0a50d88",
      5. "04dd32b3af69d8591b99a8e86a76e0fb",
      6. "04dd32b3af69f4a18a76efd89867f4f4",
      7. "04dd32b3af6a1f7925001274bbfde952",
      8. "04dd32b3af6a3fe8ea9b120ed906a57f",
      9. "04dd32b3af6a5b5c518809d3d4b76654",
      10. "04dd32b3af6a78f6ab32f1e928593c73",
      11. "04dd32b3af6a99916c665d6bbf857475",
      12. "04dd32b3af6ab558dd3f2c0afacb7d66"
      13. ]
      14. }
    • utc_id: The time since Jan 1, 1970 UTC, in microseconds, plus the utc_id_suffix string. The first 14 characters are the time in hex. The uuids/utc_id_suffix string value is appended to these.

      1. {
      2. "uuids": [
      3. "04dd32bd5eabcc@mycouch",
      4. "04dd32bd5eabee@mycouch",
      5. "04dd32bd5eac05@mycouch",
      6. "04dd32bd5eac28@mycouch",
      7. "04dd32bd5eac43@mycouch",
      8. "04dd32bd5eac58@mycouch",
      9. "04dd32bd5eac6e@mycouch",
      10. "04dd32bd5eac84@mycouch",
      11. "04dd32bd5eac98@mycouch",
      12. "04dd32bd5eacad@mycouch"
      13. ]
      14. }

    Note

    Impact of UUID choices: the choice of UUID has a significant impact on the layout of the B-tree, prior to compaction.

    For example, using a sequential UUID algorithm while uploading a large batch of documents will avoid the need to rewrite many intermediate B-tree nodes. A random UUID algorithm may require rewriting intermediate nodes on a regular basis, resulting in significantly decreased throughput and wasted disk space space due to the append-only B-tree design.

    It is generally recommended to set your own UUIDs, or use the sequential algorithm unless you have a specific need and take into account the likely need for compaction to re-balance the B-tree and reclaim wasted space.

  • utc_id_suffix

    New in version 1.3.

    The utc_id_suffix value will be appended to UUIDs generated by the utc_id algorithm. Replicating instances should have unique utc_id_suffix values to ensure uniqueness of utc_id ids.

    1. [uuid]
    2. utc_id_suffix = my-awesome-suffix
  • max_count

    New in version 1.5.1.

    No more than this number of UUIDs will be sent in a single request. If more UUIDs are requested, an HTTP error response will be thrown.

    1. [uuid]
    2. max_count = 1000

3.13.4. Vendor information

[vendor]

New in version 1.3.

CouchDB distributors have the option of customizing CouchDB’s welcome message. This is returned when requesting GET /.

  1. [vendor]
  2. name = The Apache Software Foundation
  3. version = 1.5.0

3.13.5. Content-Security-Policy

[csp]

You can configure Content-Security-Policy header for Fauxton, attachments and show/list functions separately. See MDN Content-Security-Policy for more details on CSP.

  • utils_enable

    Enable the sending of the header Content-Security-Policy for /_utils. Defaults to true:

    1. [csp]
    2. utils_enable = true
  • utils_header_value

    Specifies the exact header value to send. Defaults to:

    1. [csp]
    2. utils_header_value = default-src 'self'; img-src 'self'; font-src *; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';
  • attachments_enable

    Enable sending the Content-Security-Policy header for attachments:

    1. [csp]
    2. attachments_enable = true
  • attachments_header_value

    Specifies the exact header value to send. Defaults to:

    1. [csp]
    2. attachments_header_value = sandbox
  • showlist_enable

    Enable sending the Content-Security-Policy header for show and list functions:

    1. [csp]
    2. showlist_enable = true
  • showlist_header_value

    Specifies the exact header value to send. Defaults to:

    1. [csp]
    2. showlist_header_value = sandbox

The pre 3.2.0 behaviour is still honoured, but we recommend updating to the new format.

Experimental support of CSP headers for /_utils (Fauxton).

  • enable

    Enable the sending of the Header Content-Security-Policy:

    1. [csp]
    2. enable = true
  • header_value

    You can change the default value for the Header which is sent:

    1. [csp]
    2. header_value = default-src 'self'; img-src *; font-src *;

3.13.6. Configuration of Database Purge

[purge]

  • max_document_id_number

    New in version 3.0.

    Sets the maximum number of documents allowed in a single purge request:

    1. [purge]
    2. max_document_id_number = 100
  • max_revisions_number

    New in version 3.0.

    Sets the maximum number of accumulated revisions allowed in a single purge request:

    1. [purge]
    2. max_revisions_number = 1000
  • index_lag_warn_seconds

    New in version 3.0.

    Sets the allowed duration when index is not updated for local purge checkpoint document. Default is 24 hours:

    1. [purge]
    2. index_lag_warn_seconds = 86400

3.13.7. Configuration of Prometheus Endpoint

[prometheus]

  • additional_port

    New in version 3.2.

    Sets whether or not to create a separate, non-authenticated port (default is false):

    1. [prometheus]
    2. additional_port = true
  • bind_address

    New in version 3.2.

    The IP address to bind:

    1. [prometheus]
    2. bind_address = 127.0.0.1
  • port

    New in version 3.2.

    The port on which clients can query prometheus endpoint data without authentication

    [prometheus] port = 17986