cockroachdb / cockroachdb/cockroach

storage: reconsider default for `--cache`

Open
#128,190 2 comments 0 reactions 0 assignees View on GitHub
A-cli-flags A-storage C-enhancement T-storage
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

[The default is currently 128 MiB](https://github.com/cockroachdb/cockroach/blob/2d3ad4047e3da39d8e04adf382899397ead1e0a1/pkg/server/config.go#L61-L67). As the flag is not required, users often omit it, which can result in unexpected performance due to the very small cache size.

Some alternatives:
- Switch the default to use a percentage of available system memory (e.g. 25%).
- Make the flag required, which forces users to set it to a sensible value. The advantage of this approach is that it would also allow us to remove a bunch of code that warns about the default value.

We should also update our public documentation to reflect this change.

Jira issue: CRDB-40856

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.