4.12. Miscellaneous Parameters

4.12.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 disablescompression:




  1. [attachments]
    compression_level = 8



compressible_types

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




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



4.12.2. Statistic Calculation

[stats]
rate

Rate of statistics gathering in milliseconds:




  1. [stats]
    rate = 1000



samples

Samples are used to track the mean and standard value deviation withinspecified intervals (in seconds):




  1. [stats]
    samples = [0, 60, 300, 900]



4.12.3. UUIDs Configuration

[uuids]
algorithm


Changed in version 1.3: Added utcid algorithm.


CouchDB provides various algorithms to generate the UUID values thatare used for document __id
’s by default:




  1. [uuids]
    algorithm = sequential




Available algorithms:

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




  1. {
    "uuids": [
    "5fcbbf2cb171b1d5c3bc6df3d4affb32",
    "9115e0942372a87a977f1caf30b2ac29",
    "3840b51b0b81b46cab99384d5cd106e3",
    "b848dbdeb422164babf2705ac18173e1",
    "b7a8566af7e0fc02404bb676b47c3bf7",
    "a006879afdcae324d70e925c420c860d",
    "5f7716ee487cc4083545d4ca02cd45d4",
    "35fdd1c8346c22ccc43cc45cd632e6d6",
    "97bbdb4a1c7166682dc026e1ac97a64c",
    "eb242b506a6ae330bda6969bb2677079"
    ]
    }




-
sequential: Monotonically increasing ids with random increments.The first 26 hex characters are random, the last 6 increment inrandom amounts until an overflow occurs. On overflow, the randomprefix is regenerated and the process starts over.




  1. {
    "uuids": [
    "4e17c12963f4bee0e6ec90da54804894",
    "4e17c12963f4bee0e6ec90da5480512f",
    "4e17c12963f4bee0e6ec90da54805c25",
    "4e17c12963f4bee0e6ec90da54806ba1",
    "4e17c12963f4bee0e6ec90da548072b3",
    "4e17c12963f4bee0e6ec90da54807609",
    "4e17c12963f4bee0e6ec90da54807718",
    "4e17c12963f4bee0e6ec90da54807754",
    "4e17c12963f4bee0e6ec90da54807e5d",
    "4e17c12963f4bee0e6ec90da54808d28"
    ]
    }




-
utc_random: The time since Jan 1, 1970 UTC, in microseconds. Thefirst 14 characters are the time in hex. The last 18 are random.




  1. {
    "uuids": [
    "04dd32b3af699659b6db9486a9c58c62",
    "04dd32b3af69bb1c2ac7ebfee0a50d88",
    "04dd32b3af69d8591b99a8e86a76e0fb",
    "04dd32b3af69f4a18a76efd89867f4f4",
    "04dd32b3af6a1f7925001274bbfde952",
    "04dd32b3af6a3fe8ea9b120ed906a57f",
    "04dd32b3af6a5b5c518809d3d4b76654",
    "04dd32b3af6a78f6ab32f1e928593c73",
    "04dd32b3af6a99916c665d6bbf857475",
    "04dd32b3af6ab558dd3f2c0afacb7d66"
    ]
    }




-
utc_id: The time since Jan 1, 1970 UTC, in microseconds, plus theutc_id_suffix string. The first 14 characters are the time inhex. The uuids/utc_id_suffix string value is appended tothese.




  1. {
    "uuids": [
    "04dd32bd5eabcc@mycouch",
    "04dd32bd5eabee@mycouch",
    "04dd32bd5eac05@mycouch",
    "04dd32bd5eac28@mycouch",
    "04dd32bd5eac43@mycouch",
    "04dd32bd5eac58@mycouch",
    "04dd32bd5eac6e@mycouch",
    "04dd32bd5eac84@mycouch",
    "04dd32bd5eac98@mycouch",
    "04dd32bd5eacad@mycouch"
    ]
    }





Note

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

For example, using a sequential UUID algorithm while uploading alarge batch of documents will avoid the need to rewrite manyintermediate B-tree nodes. A random UUID algorithm may requirerewriting intermediate nodes on a regular basis, resulting insignificantly decreased throughput and wasted disk space space due tothe append-only B-tree design.

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

utc_id_suffix


New in version 1.3.


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




  1. [uuid]
    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. Ifmore UUIDs are requested, an HTTP error response will be thrown.




  1. [uuid]
    max_count = 1000



4.12.4. Vendor information

[vendor]


New in version 1.3.


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




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



4.12.5. Content-Security-Policy

[csp]

Experimental support of CSP Headers for /_utils (Fauxton).
enable

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




  1. [csp]
    enable = true



header_value

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




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



原文: http://docs.couchdb.org/en/stable/config/misc.html