You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/tooling/tcm/tcm_ui_overview.rst
+132-7Lines changed: 132 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ To log into |tcm| after bootstrap, use the following credentials:
36
36
After logging in with the default password:
37
37
38
38
#. Adjust the :ref:`password policy <tcm_access_control_password_policy>`
39
-
in accordance to the security requirements that apply in your organization.
39
+
in accordance with the security requirements that apply in your organization.
40
40
#. Change the ``admin`` user's password on the :ref:`User settings <tcm_ui_user_settings>` page.
41
41
42
42
To log out of |tcm|, click the user's name in the header and click **Log out**.
@@ -64,7 +64,7 @@ Onboarding
64
64
----------
65
65
66
66
The **Onboarding** item of the navigation pane starts the interactive onboarding
67
-
tutorial. Use it to get familiar with main |tcm| features directly in the web interface.
67
+
tutorial. Use it to get familiar with the main |tcm| features directly in the web interface.
68
68
69
69
.. _tcm_ui_visibility:
70
70
@@ -92,7 +92,7 @@ There are the following page groups:
92
92
- **Tools**: |tcm| administration.
93
93
- **Settings**: runtime management of |tcm| settings.
94
94
95
-
Read on to learn what you can do on pages of these groups.
95
+
Read on to learn what you can do on the pages of these groups.
96
96
97
97
.. _tcm_ui_cluster:
98
98
@@ -156,14 +156,139 @@ The instance page has an **Actions** menu at the top that allows you to:
156
156
- edit the instance configuration
157
157
- remove the instance
158
158
159
+
Slabs tab overview
160
+
~~~~~~~~~~~~~~~~~~
161
+
162
+
The **Slabs** tab in the TCM Web UI visualizes memory allocation within each Tarantool instance using the slab allocator.
163
+
164
+
This tab is useful for:
165
+
166
+
- identifying memory fragmentation
167
+
- analyzing slab saturation by object size
168
+
- debugging excessive memory use in real time
169
+
170
+
Data source
171
+
^^^^^^^^^^^
172
+
173
+
This visualization is based on the output of:
174
+
175
+
.. code-block:: lua
176
+
177
+
box.slab.stats()
178
+
179
+
This function returns a Lua table with per-class (per object size) memory allocation statistics from the slab allocator.
180
+
More about :ref:`box.slab.stats() <box_slab_stats>`.
181
+
182
+
Each entry in the output contains:
183
+
184
+
- ``item_size``: object size class
185
+
- ``slab_count``: number of slab blocks
186
+
- ``slab_size``: memory size of each slab
187
+
- ``item_count``: number of allocated objects
188
+
- ``mem_used``: bytes used
189
+
- ``mem_free``: bytes free
190
+
191
+
These values are parsed and rendered as visual elements in the UI.
192
+
193
+
Slab visualization
194
+
^^^^^^^^^^^^^^^^^^
195
+
196
+
Each block represents a single slab (a fixed-size memory region). The color indicates how full the slab is:
197
+
198
+
- **Green** — the slab is less than 30% full
199
+
- **Red** — slab is full (100% usage)
200
+
- **Gradient colors between green and red** — indicate intermediate fill levels (e.g., 30%, 50%, 75%)
201
+
202
+
The color transitions smoothly, providing a quick visual way to understand which slabs are:
203
+
204
+
- actively used
205
+
- partially utilized
206
+
- potentially underused or contributing to memory fragmentation
207
+
208
+
In the example screenshot:
209
+
210
+
- Slab #17 (168 KB) — 75% full (dark red)
211
+
- Slab #18 (320 KB) — 53% full (brownish-red)
212
+
- Slab #16 (40 KB) — only 1% used (bright green)
213
+
- Slab #2 (56 B) — 60% used (intermediate gradient)
214
+
215
+
Each slab block’s size in the visualization reflects the total memory allocated for its ``item_size`` class --
216
+
the more memory allocated, the larger the visual representation.
217
+
218
+
.. image:: _images/tcm_ui_slabs.png
219
+
:width:1100px
220
+
221
+
Calculating fill percentage
222
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
223
+
224
+
The overall fill percentage for a slab is calculated using:
225
+
226
+
.. code-block:: text
227
+
228
+
fill % = (item_count * item_size) / (slab_count * slab_size)
229
+
230
+
However, each slab is visualized individually, so different fill levels across slabs will result in various colors within the same row.
231
+
232
+
Behavior across Tarantool instances
233
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
234
+
235
+
Slab allocation may vary between instances in the same replicaset due to differences in configuration, data loading order, and use of local memory.
236
+
The reasons are:
237
+
238
+
1. Slab allocation may differ because each instance can use its own values for ``slab_alloc_factor`` and ``slab_alloc_granularity``. These parameters control how memory is divided into size classes and slabs, affecting memory layout and potential fragmentation.
239
+
2. Differences also appear during replica join or restart. A replica allocates memory for tuples in primary index order, while on the master, allocation follows the order of incoming requests. This results in different slab structures and usually lower fragmentation on replicas after a restart.
240
+
3. Local and temporary spaces exist only on specific instances and are not replicated. They consume memory independently and contribute to differences in slab allocation across nodes.
241
+
242
+
Slab allocator tuning
243
+
^^^^^^^^^^^^^^^^^^^^^
244
+
245
+
You can fine-tune the allocator behavior with two configuration options:
- :ref:`slab_alloc_granularity <configuration_reference_memtx_slab_alloc_granularity>` – minimum allocation step (in bytes) for the small allocator. Default value: ``8``
249
+
250
+
These parameters affect how memory is allocated per object size class and can help:
251
+
252
+
- reduce internal fragmentation
253
+
- optimize memory usage
254
+
- improve slab locality and performance
255
+
- better understand memory consumption via the **Slabs** tab
0 commit comments