mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
plugin/cache: Document actual cache defaults (#2249)
This commit is contained in:
7
plugin/cache/README.md
vendored
7
plugin/cache/README.md
vendored
@@ -24,8 +24,8 @@ cache [TTL] [ZONES...]
|
|||||||
* **ZONES** zones it should cache for. If empty, the zones from the configuration block are used.
|
* **ZONES** zones it should cache for. If empty, the zones from the configuration block are used.
|
||||||
|
|
||||||
Each element in the cache is cached according to its TTL (with **TTL** as the max).
|
Each element in the cache is cached according to its TTL (with **TTL** as the max).
|
||||||
A cache is divided into 256 shards, each holding up to 512 items by default - for a total size
|
A cache is divided into 256 shards, each holding up to 39 items by default - for a total size
|
||||||
of 256 * 512 = 131,072 items.
|
of 256 * 39 = 9984 items.
|
||||||
|
|
||||||
If you want more control:
|
If you want more control:
|
||||||
|
|
||||||
@@ -53,7 +53,8 @@ cache [TTL] [ZONES...] {
|
|||||||
|
|
||||||
## Capacity and Eviction
|
## Capacity and Eviction
|
||||||
|
|
||||||
If **CAPACITY** is not specified, the default cache size is 10,000 per cache. The minimum allowed cache size is 1024.
|
If **CAPACITY** _is not_ specified, the default cache size is 9984 per cache. The minimum allowed cache size is 1024.
|
||||||
|
If **CAPACITY** _is_ specified, the actual cache size used will be rounded down to the nearest number divisible by 256 (so all shards are equal in size).
|
||||||
|
|
||||||
Eviction is done per shard. In effect, when a shard reaches capacity, items are evicted from that shard.
|
Eviction is done per shard. In effect, when a shard reaches capacity, items are evicted from that shard.
|
||||||
Since shards don't fill up perfectly evenly, evictions will occur before the entire cache reaches full capacity.
|
Since shards don't fill up perfectly evenly, evictions will occur before the entire cache reaches full capacity.
|
||||||
|
|||||||
Reference in New Issue
Block a user