Anshuman Tiwari
Anshuman Tiwari

Reputation: 454

How to check max-sql-memory and cache settings for an already running instance of cockroach db?

I have a cockroachdb instance running in production and would like to know the settings for the --max-sql-memory and --cache specified when the database was started. I am trying to enhance performance by following this production checklist but I am not able infer the setting either on dashboard or sql console.

Where can I check the values of max-sql-memory and cache value ?

Note: I am able to access the cockroachdb admin console and sql tables.

Upvotes: 2

Views: 830

Answers (1)

Marc
Marc

Reputation: 21035

You can find this information in the logs, shortly after node startup:

I190626 10:22:47.714002 1 cli/start.go:1082  CockroachDB CCL v19.1.2 (x86_64-unknown-linux-gnu, built 2019/06/07 17:32:15, go1.11.6)
I190626 10:22:47.815277 1 server/status/recorder.go:610  available memory from cgroups (8.0 EiB) exceeds system memory 31 GiB, using system memory
I190626 10:22:47.815311 1 server/config.go:386  system total memory: 31 GiB
I190626 10:22:47.815411 1 server/config.go:388  server configuration:
max offset             500000000
cache size             7.8 GiB  <====
SQL memory pool size   7.8 GiB  <====
scan interval          10m0s
scan min idle time     10ms
scan max idle time     1s
event log enabled      true

If the logs have been rotated, the value depends on the flags. The defaults for v19.1 are 128MB, with recommended settings being 0.25 (a quarter of system memory).

The settings are not currently logged periodically or exported through metrics.

Upvotes: 3

Related Questions