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

Implement log rotation in docker-compose file #1797

Merged
merged 1 commit into from
Jul 16, 2020

Conversation

rhyslbw
Copy link
Contributor

@rhyslbw rhyslbw commented Jun 25, 2020

@rhyslbw rhyslbw requested review from KtorZ and piotr-iohk June 25, 2020 02:19
@rhyslbw rhyslbw self-assigned this Jun 25, 2020
Copy link
Contributor

@rvl rvl left a comment

Choose a reason for hiding this comment

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

How long does cardano-node take to emit 2000k of logs under this configuration?
You would want it to retain logs for at least a couple of days.

@rhyslbw rhyslbw marked this pull request as draft June 26, 2020 02:05
@rhyslbw
Copy link
Contributor Author

rhyslbw commented Jun 26, 2020

@rvl Good call, my assessment was based on my own config, so am now running the stack against NETWORK=mainnet for a few hours to determine a more suitable default.

@rhyslbw
Copy link
Contributor Author

rhyslbw commented Jun 29, 2020

cardano-node emits ~ 3.75MB per epoch on the mainnet, so the resulting mainnet sync from genesis emits around 750MB of logs within the first few hours. What's your preference here? Dedicating that chunk of disk seems unreasonable when all we're doing is fast-forwarding through time, with the relevance of old epochs having the same meaning. I expect critical errors in the sync should be on disk if it's needing to be debugged. To ensure the current and previous epochs, plus their transitions are included, I propose:

  max-size: "400k"
  max-file: "20"

@rhyslbw
Copy link
Contributor Author

rhyslbw commented Jun 29, 2020

The base for cardano-wallet is the clock check, 5mins apart:

cardano-wallet_1  | [cardano-wallet.ntp-client:Info:14] [2020-06-29 01:41:17.78 UTC] query to ntp client invoked
cardano-wallet_1  | [cardano-wallet.ntp-client:Info:14] [2020-06-29 01:41:18.93 UTC] local clock is drifting by -27088μs
cardano-wallet_1  | [cardano-wallet.ntp-client:Info:14] [2020-06-29 01:46:18.96 UTC] query to ntp client invoked
cardano-wallet_1  | [cardano-wallet.ntp-client:Info:14] [2020-06-29 01:46:20.17 UTC] local clock is drifting by -20103μs

Do you have a simulation that can provide some insight into the cardano-wallet logging behaviour, or is what I've submitted here satisfactory?

@rvl
Copy link
Contributor

rvl commented Jul 14, 2020

Can we just say that 500MB of logs is too much. Anything less than 500MB of logs is OK. This is 1/10th of the mainnet chain db size.

So make it 10 rotations of 50MB each. And also there is a log compression flag which may help reduce impact of logs: https://docs.docker.com/config/containers/logging/json-file/#options

@rvl rvl added the ADDING FEATURE Mark a PR as adding a new feature, for auto-generated CHANGELOG label Jul 14, 2020
@rhyslbw rhyslbw force-pushed the rhyslbw/docker-compose-log-rotation branch from dd005d1 to 20ed8b2 Compare July 16, 2020 04:21
@rhyslbw rhyslbw marked this pull request as ready for review July 16, 2020 04:21
@rhyslbw rhyslbw requested review from rvl and removed request for KtorZ and piotr-iohk July 16, 2020 04:21
Copy link
Contributor

@rvl rvl left a comment

Choose a reason for hiding this comment

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

Looks fine

@rvl rvl merged commit 53805cc into master Jul 16, 2020
@rvl rvl deleted the rhyslbw/docker-compose-log-rotation branch July 16, 2020 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADDING FEATURE Mark a PR as adding a new feature, for auto-generated CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants