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

upgrade to raulk/[email protected] #5396

Merged
merged 1 commit into from
Jan 20, 2021
Merged

upgrade to raulk/[email protected] #5396

merged 1 commit into from
Jan 20, 2021

Conversation

raulk
Copy link
Member

@raulk raulk commented Jan 20, 2021

This pulls in the improvements introduced in:

Lotus tries to initialize the watchdog in the following order of precedence:

  1. If a max heap limit has been provided, initialize a heap-driven watchdog.
  2. Else, try to initialize a cgroup-driven watchdog.
  3. Else, try to initialize a system-driven watchdog.
  4. Else, log a warning that the system is flying solo, and return.

This PR also enabled automatic heap profile capture when memory usage surpasses 90% of the limit. Profiles are written to <LOTUS_HOME>/heapprof. A single heap profile is captured per episode, with a max of 10 episodes captured during the lifetime of the process. Episode = instance of usage climbing above the 90% threshold.


Closes #5336.

This pulls in the improvements introduced in:
  - https://github.com/raulk/go-watchdog/releases/tag/v1.0.0
  - https://github.com/raulk/go-watchdog/releases/tag/v1.0.1

Lotus tries to initialize the watchdog in the following order of precedence:
  1. If a max heap limit has been provided, initialize a heap-driven watchdog.
  2. Else, try to initialize a cgroup-driven watchdog.
  3. Else, try to initialize a system-driven watchdog.
  4. Else, log a warning that the system is flying solo, and return.

This PR also enabled automatic heap profile capture when memory usage
surpasses 90% of the limit. Profiles are written to <LOTUS_HOME>/heapprof.
A single heap profile is captured per episode, with a max of 10 episodes
captured during the lifetime of the process. Episode = instance of usage
climbing above the 90% threshold.
@magik6k magik6k merged commit fb27969 into master Jan 20, 2021
@magik6k magik6k deleted the feat/watchdog-v1 branch January 20, 2021 19:54
// will be captured during life of this process.
watchdog.HeapProfileDir = filepath.Join(lr.Path(), "heapprof")
watchdog.HeapProfileMaxCaptures = 10
watchdog.HeapProfileThreshold = 0.1
Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, this value leaked from testing. It should be 0.9. Will follow up with a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

memory watchdog: upgrade to upcoming v1
2 participants