Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memtx read view statistics #8501

Closed
locker opened this issue Mar 27, 2023 · 0 comments · Fixed by #8471, #8482, tarantool/small#60, tarantool/small#61 or #8495
Closed

Memtx read view statistics #8501

locker opened this issue Mar 27, 2023 · 0 comments · Fixed by #8471, #8482, tarantool/small#60, tarantool/small#61 or #8495
Assignees
Labels
3.0 Target is 3.0 and all newer release/master branches feature A new functionality memtx

Comments

@locker
Copy link
Member

locker commented Mar 27, 2023

We need a way to figure out how much memory is consumed by memtx read view. This should include both system read views (checkpointing, replication) and user read views (https://github.com/tarantool/tarantool-ee/issues/143).

Proposed API: add data and index sub-tables to box.stat.memtx() that would show much memory is consumed total and by read views.

@locker locker added feature A new functionality memtx 3.0 Target is 3.0 and all newer release/master branches labels Mar 27, 2023
@locker locker self-assigned this Mar 27, 2023
locker added a commit to locker/tarantool that referenced this issue Mar 28, 2023
Closes tarantool#8501

@TarantoolBot document
Title: Document memtx read view statistics

New entries have been added to `box.stat.memtx()` output:

```
tarantool> box.stat.memtx().data
---
- garbage: 0
  total: 24986
  read_view: 0
...

tarantool> box.stat.memtx().index
---
- read_view: 0
  total: 933888
...
```

`data` shows how much memory is allocated for memtx tuples:
 - `data.total` - total amount of memory allocated for data tuples.
   This includes `data.read_view` and `data.garbage` plus tuples that
   are actually stored in memtx spaces.
 - `data.read_view` - memory held for read views.
 - `data.garbage` - memory that is unused and scheduled to be freed
   (freed lazily on memory allocation).

`index` shows how much memory is allocated for memtx index extents:
 - `index.total` - total amount of memory allocated for indexing data.
   This includes `index.read_view` plus memory used for indexing tuples
   that are actually stored in memtx spaces.
 - `index.read_view` - memory held for read views.

All numbers are given in bytes.

`data.read_view` and `index.read_view` include memory allocated both for
system read views (snapshot, replication) and user read views (EE-only).
They should be non-zero only if there are open read views. To list all
open read views, use `box.read_view.list()`.
locker added a commit that referenced this issue Mar 30, 2023
Closes #8501

@TarantoolBot document
Title: Document memtx read view statistics

New entries have been added to `box.stat.memtx()` output:

```
tarantool> box.stat.memtx().data
---
- garbage: 0
  total: 24986
  read_view: 0
...

tarantool> box.stat.memtx().index
---
- read_view: 0
  total: 933888
...
```

`data` shows how much memory is allocated for memtx tuples:
 - `data.total` - total amount of memory allocated for data tuples.
   This includes `data.read_view` and `data.garbage` plus tuples that
   are actually stored in memtx spaces.
 - `data.read_view` - memory held for read views.
 - `data.garbage` - memory that is unused and scheduled to be freed
   (freed lazily on memory allocation).

`index` shows how much memory is allocated for memtx index extents:
 - `index.total` - total amount of memory allocated for indexing data.
   This includes `index.read_view` plus memory used for indexing tuples
   that are actually stored in memtx spaces.
 - `index.read_view` - memory held for read views.

All numbers are given in bytes.

`data.read_view` and `index.read_view` include memory allocated both for
system read views (snapshot, replication) and user read views (EE-only).
They should be non-zero only if there are open read views. To list all
open read views, use `box.read_view.list()`.
locker added a commit to locker/tarantool that referenced this issue Apr 6, 2023
This may result in invalid statistics if there's more than 4 GB
allocated for index extents.

Fixes commit a75f4b7 ("memtx: introduce read view statistics").
Follow-up tarantool#8501
Coverity report 1537026, 1537027.

NO_DOC=bug fix
NO_CHANGELOG=unreleased
NO_TEST=complicated; checked by coverity
locker added a commit to locker/tarantool that referenced this issue Apr 6, 2023
This may result in invalid statistics if there's more than 4 GB
allocated for index extents.

Fixes commit a75f4b7 ("memtx: introduce read view statistics").
Follow-up tarantool#8501
Coverity report 1537026, 1537027.

NO_DOC=bug fix
NO_CHANGELOG=unreleased
NO_TEST=complicated; checked by coverity
locker added a commit that referenced this issue Apr 6, 2023
This may result in invalid statistics if there's more than 4 GB
allocated for index extents.

Fixes commit a75f4b7 ("memtx: introduce read view statistics").
Follow-up #8501
Coverity report 1537026, 1537027.

NO_DOC=bug fix
NO_CHANGELOG=unreleased
NO_TEST=complicated; checked by coverity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment