[MXS-2724] Expose memory usage information Created: 2019-10-15  Updated: 2023-05-08  Resolved: 2022-07-04

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: None
Fix Version/s: 22.08.0

Type: New Feature Priority: Minor
Reporter: markus makela Assignee: Johan Wikman
Resolution: Fixed Votes: 2
Labels: Monitoring

Issue Links:
Relates
relates to MXS-3822 MaxScale Global Memory Use Indicator Closed
relates to MXS-4186 Add "Memory" column to the session di... Closed
Sprint: MXS-SPRINT-159, MXS-SPRINT-160

 Description   

At times it's very hard to know why MaxScale is consuming memory and which part in particular is causing it. Exposing e.g. the DCB buffer lengths would give an indication as to where the memory is going.



 Comments   
Comment by Johan Wikman [ 2020-08-26 ]

It would be relatively straightforward to associate all memory allocations made while routing, with the session on behalf of which the memory allocation is made. That would make it possible to track how much memory a particular session consumes and how the memory consumption evolves over time. With some additional work it would also be possible to track which module - protocol, filter, router, etc. - is responsible for performing the memory allocation.

Comment by Johan Wikman [ 2022-06-30 ]

In 22.08 there will be slightly more information available regarding the memory usage. maxctrl show session will return the following:

├───────────────────┼──────────────────────────────────┤
│ Memory            │ {                                │
│                   │     "connection_buffers": 67226, │
│                   │     "last_queries": 0,           │
│                   │     "session_history": 774,      │
│                   │     "total": 68000,              │
│                   │     "variables": 0               │
│                   │ }                                │
└───────────────────┴──────────────────────────────────┘

This does not represent the total amount of memory use by a particular session, but provides figures that can be used for detecting anomalous behavior. The total field is currently simply the sum of all fields, and it is shown by maxctrl list sessions:

┌────┬───────┬───────────┬──────────────────────────┬──────┬─────────┬────────┐
│ Id │ User  │ Host      │ Connected                │ Idle │ Service │ Memory │
├────┼───────┼───────────┼──────────────────────────┼──────┼─────────┼────────┤
│ 1  │ johan │ 127.0.0.1 │ Thu Jun 30 15:44:29 2022 │ 305  │ RWS     │ 68000  │
└────┴───────┴───────────┴──────────────────────────┴──────┴─────────┴────────┘

Comment by Naresh Chandra [ 2022-06-30 ]

Hi Johan, can we also show which session or query is consuming more memory?

Alert in the GUI with Critical/Warning/Notice in the GUI and through auto mail alert would be a good and it will be very useful feature for us.

Comment by Johan Wikman [ 2022-07-04 ]

naresh.chandra@copart.com Please create a separate feature request for that.

Comment by Johan Wikman [ 2022-07-04 ]

This is but the first step on this path. To be able to report the memory usage in greater detail, some architectural changes are needed and they are not possible to make in 22.08.

Comment by Naresh Chandra [ 2022-07-04 ]

Sure Johan, thanks for the update.

Generated at Thu Feb 08 04:16:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.