Skip to content

Conversation

@corhere
Copy link
Contributor

@corhere corhere commented Jan 9, 2024

- What I did
Reduced the frequency of disk writes when containers are health-checked.

- How I did it
Only update the health status in-memory when a container health probe finishes. It will be checkpointed to disk the next time container.CheckpointTo() is called, typically when the container configuration is next updated or the container lifecycle state changes. Running containers will not be checkpointed on daemon shutdown when live-restore is enabled, but it does not matter: the health status and probe log will be zeroed out when the daemon starts back up.

- How to verify it

- Description for the changelog

  • Container health status is flushed to disk less frequently, reducing wear on flash storage.

- A picture of a cute animal (not mandatory but encouraged)

@corhere corhere added status/1-design-review kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. area/daemon Core Engine labels Jan 9, 2024
@corhere corhere changed the title Lazy health status Lazily checkpoint container health status to disk Jan 9, 2024
The health status and probe log of containers are not mission-criticial
data which must survive a crash. It is not worth prematrely wearing out
consumer-grade flash storage by overwriting and fsync()ing the container
config on after every probe. Update only the live Container object and
the ViewDB replica on every container health probe instead. It will
eventually get checkpointed along with some other state (or config)
change. Running containers will not be checkpointed on daemon shutdown
when live-restore is enabled, but it does not matter: the health status
and probe log will be zeroed out when the daemon starts back up.

Signed-off-by: Cory Snider <[email protected]>
@corhere corhere force-pushed the lazy-health-status branch from c2a1a15 to 97d32bb Compare January 16, 2024 19:10
@corhere corhere marked this pull request as ready for review January 16, 2024 19:24
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Core Engine impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/1-design-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants