Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
lower default max chunk cache size to 512MB
Browse files Browse the repository at this point in the history
4GB by default is too much. most deployments will keep filling their
cache with chunks that become stale.
  • Loading branch information
Dieterbe committed Sep 25, 2019
1 parent c6b8b70 commit 25d4050
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docker/docker-chaos/metrictank.ini
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ buffer-size = 20000

## chunk cache ##
[chunk-cache]
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
# maximum size of chunk cache in bytes. 512 MB = (1024 ^ 2) * 512 = 536870912
# 0 disables cache
max-size = 4294967296
max-size = 536870912

## http api ##
[http]
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-cluster-query/metrictank.ini
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ buffer-size = 20000

## chunk cache ##
[chunk-cache]
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
# maximum size of chunk cache in bytes. 512 MB = (1024 ^ 2) * 512 = 536870912
# 0 disables cache
max-size = 4294967296
max-size = 536870912

## http api ##
[http]
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-cluster/metrictank.ini
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ buffer-size = 20000

## chunk cache ##
[chunk-cache]
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
# maximum size of chunk cache in bytes. 512 MB = (1024 ^ 2) * 512 = 536870912
# 0 disables cache
max-size = 4294967296
max-size = 536870912

## http api ##
[http]
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-dev-custom-cfg-kafka/metrictank.ini
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ buffer-size = 20000

## chunk cache ##
[chunk-cache]
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
# maximum size of chunk cache in bytes. 512 MB = (1024 ^ 2) * 512 = 536870912
# 0 disables cache
max-size = 4294967296
max-size = 536870912

## http api ##
[http]
Expand Down
4 changes: 2 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ buffer-size = 20000

```
[chunk-cache]
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
# maximum size of chunk cache in bytes. 512 MB = (1024 ^ 2) * 512 = 536870912
# 0 disables cache
max-size = 4294967296
max-size = 536870912
```

## http api ##
Expand Down
4 changes: 2 additions & 2 deletions mdata/cache/ccache.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ var (

func init() {
flags := flag.NewFlagSet("chunk-cache", flag.ExitOnError)
// (1024 ^ 3) * 4 = 4294967296 = 4G
flags.Uint64Var(&maxSize, "max-size", 4294967296, "Maximum size of chunk cache in bytes. 0 disables cache")
// 512 MB = (1024 ^ 2) * 512 = 536870912
flags.Uint64Var(&maxSize, "max-size", 536870912, "Maximum size of chunk cache in bytes. 0 disables cache")
globalconf.Register("chunk-cache", flags, flag.ExitOnError)
}

Expand Down
4 changes: 2 additions & 2 deletions metrictank-sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ buffer-size = 20000

## chunk cache ##
[chunk-cache]
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
# maximum size of chunk cache in bytes. 512 MB = (1024 ^ 2) * 512 = 536870912
# 0 disables cache
max-size = 4294967296
max-size = 536870912

## http api ##
[http]
Expand Down
4 changes: 2 additions & 2 deletions scripts/config/metrictank-docker.ini
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ buffer-size = 20000

## chunk cache ##
[chunk-cache]
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
# maximum size of chunk cache in bytes. 512 MB = (1024 ^ 2) * 512 = 536870912
# 0 disables cache
max-size = 4294967296
max-size = 536870912

## http api ##
[http]
Expand Down
4 changes: 2 additions & 2 deletions scripts/config/metrictank-package.ini
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ buffer-size = 20000

## chunk cache ##
[chunk-cache]
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
# maximum size of chunk cache in bytes. 512 MB = (1024 ^ 2) * 512 = 536870912
# 0 disables cache
max-size = 4294967296
max-size = 536870912

## http api ##
[http]
Expand Down

0 comments on commit 25d4050

Please sign in to comment.