Skip to content

Conversation

lukebakken
Copy link
Collaborator

os_mon is only used on win32 systems, so there is no need to start it on unix systems. In addition, os_mon can pollute the log files with memory high watermark messages that can be confused with those emitted by RabbitMQ's memory monitor.

At some point, RabbitMQ should use os_mon for disk and memory monitoring, but that day is a ways away.

@lukebakken lukebakken self-assigned this Aug 26, 2025
@mergify mergify bot added the make label Aug 26, 2025
@lukebakken lukebakken force-pushed the lukebakken/os_mon-win32-only branch 4 times, most recently from 8c73641 to a0c021f Compare August 27, 2025 21:37
`os_mon` is only used on `win32` systems, so there is no need to start
it on `unix` systems. In addition, `os_mon` can pollute the log files
with memory high watermark messages that can be confused with those
emitted by RabbitMQ's memory monitor.

At some point, RabbitMQ _should_ use `os_mon` for disk and memory
monitoring, but that day is a ways away.

On `win32` systems, enable `memsup` in the `os_mon` application
environment before starting the `os_mon` app.
@lukebakken lukebakken force-pushed the lukebakken/os_mon-win32-only branch from a0c021f to 2ab049d Compare August 27, 2025 21:40
@gomoripeti
Copy link
Contributor

Just mentioning that although the os_mon erlang application is started, the memsup, disksup etc components should not be started any more. Rabbit has a mechanism to disable them by default. (https://github.com/rabbitmq/rabbitmq-server/blob/v4.1.3/deps/rabbit_common/src/rabbit_env.erl#L310) But that mechanism did not work because os_mon was a dependency also of the rabbit_common app which was started before rabbit_prelaunch (#13759 (reply in thread)). This commit #13861 removed that dependency, so in latest versions memsup and friends should not be started by default and should not log any unexpected lines.

This commit to not even start os_mon application might make sense, but I think it is somewhat less relevant than before.

@lukebakken
Copy link
Collaborator Author

Thanks @gomoripeti - this is what @the-mikedavis and I are seeing as well. Certain RabbitMQ versions (like 4.0.6) have the "memsup starting when it shouldn't" behavior.

@the-mikedavis
Copy link
Collaborator

Nice, thanks for the details @gomoripeti! I tried a bunch of different versions and indeed on 4.1.1 (where #13867 is backported) I see whereis(memsup) starting to return undefined instead of a pid.

@lukebakken I think we need to keep os_mon as a dependency since it is used (albeit only on windows) - dialyzer isn't happy about removing it. And as you say we should eventually migrate back to os_mon.

(For extra context: there are some old TODO comments saying to migrate back once OTP implemented/exposed/documented some functions which have now been exposed for many versions. I'm not familiar with the history here but the Rabbit disk and memory monitors look like forks or vendors of os_mon)

@lukebakken
Copy link
Collaborator Author

@the-mikedavis good point about dialyzer. I'll close this.

@lukebakken lukebakken closed this Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants