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

Make memory monitor configurable and disable it by default #4606

Merged

Conversation

OhmSpectator
Copy link
Member

@OhmSpectator OhmSpectator commented Feb 10, 2025

This PR introduces a way to enable or disable the memory monitor dynamically through the global configuration option memory-monitor.enabled. Since the memory monitor is a new component with limited real-world testing, it is disabled by default to ensure system stability. Users can enable it manually if needed.

The changes include:

  • Adding memory-monitor.enabled to the global config and updating handling logic to pause or resume the memory monitor container accordingly.
  • Updating documentation to describe how to use the new option.
  • Setting the default value of memory-monitor.enabled to false so the memory monitor starts in a paused state unless explicitly enabled.

This ensures that the system remains stable while allowing users to experiment with the memory monitor when needed.

@OhmSpectator OhmSpectator force-pushed the feature/memory-monitor-disable branch 2 times, most recently from 626c175 to f0186d5 Compare February 10, 2025 21:50
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The choice of naming means we'll have double negatives like
memory-monitor.disabled=false

Why not name it memory-monitor.enabled to avoid this?

@OhmSpectator
Copy link
Member Author

The choice of naming means we'll have double negatives like
memory-monitor.disabled=false

Why not name it memory-monitor.enabled to avoid this?

Makes sense, will change it.

The memory monitor has been observed to cause system performance
degradation in some cases. Since it is still in the early stages of
integration into production, it is important to provide a safe and
convenient way to disable it if issues arise.

To address this, this commit introduces a new global config option,
`memory-monitor.enabled`, which allows dynamically enabling or disabling
the memory monitor. When not set, the memory monitor container will be
paused, effectively stopping its operation without requiring manual
intervention.

Technically, the memory monitor container always starts with the system,
regardless of the config setting. If `memory-monitor.enabled` is set
to `false`, the container will be paused as soon as the global config is
parsed. This ensures that the option is applied early after device
startup while maintaining a consistent container lifecycle.

To implement this, the commit adds `MemoryMonitorEnabled` to the global
settings, introduces logic to pause or resume the memory monitor
container via containerd, and updates the global config handling to
apply the new setting dynamically.

Signed-off-by: Nikolay Martyanov <[email protected]>
@OhmSpectator OhmSpectator force-pushed the feature/memory-monitor-disable branch from f0186d5 to 12861ce Compare February 11, 2025 10:07
@OhmSpectator
Copy link
Member Author

The choice of naming means we'll have double negatives like memory-monitor.disabled=false

Why not name it memory-monitor.enabled to avoid this?

Fixed

@OhmSpectator
Copy link
Member Author

I would also like to bring the exact change in 13.4... To make it less risky during the upgrade.

@OhmSpectator OhmSpectator added the stable Should be backported to stable release(s) label Feb 11, 2025
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I think the markdown text should be reworded a bit.

This commit updates the documentation to include the
`memory-monitor.enabled` global configuration option. It explains how
the option can be used to start the memory monitor if needed and notes
its potential impact on system performance.

Signed-off-by: Nikolay Martyanov <[email protected]>
The memory monitor is a new component with limited real-world testing.
To ensure system stability, it is now disabled by default. Users can
enable it manually if needed.

This commit updates the default value of `memory-monitor.enabled` to
`false` in the global config and documentation, reflecting the change in
behavior.

Signed-off-by: Nikolay Martyanov <[email protected]>
@OhmSpectator OhmSpectator force-pushed the feature/memory-monitor-disable branch from 12861ce to 8f81e27 Compare February 11, 2025 19:47
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@OhmSpectator OhmSpectator merged commit 41289af into lf-edge:master Feb 12, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stable Should be backported to stable release(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants