-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add rotation feature to docker logs #563
Conversation
@@ -11,6 +11,7 @@ start() { | |||
else | |||
|
|||
docker run -d {{docker_image_run_opt}} \ | |||
--log-opt max-size=2M --log-opt max-file=5 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2M?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maximal 5 files, each file maximal 2 MB. So in long term, the disk occupation should be 8 MB ~ 10 MB for each container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave some comments on how the number is picked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want to set the maximal log size for each container to 10 MB. Then overall it will be ~100 MB on a switch.
Then I choose 2M * 5, so there is at least 8M log in long running. If choosing 5M * 2, then the log size will fluctuate between 5M ~ 10M, which is not so good if you need more history.
should we log all of them to the syslog and keep none of them. syslog Writes logging messages to the syslog facility. The syslog daemon must be running on the host machine. |
Pushed new commit to resolve conflicting with --log-driver argument. To answer @lguohan question, if docker logs are ready to be moved to host syslog, we will use 'syslog' as docker log driver, ie. there is no docker logs at all, no need to rotate. Otherwise, the default docker driver will be 'json-file', and the default size limitation is no limitation, which is the problem we are trying to solve in this PR. |
@qiluo-msft: I'm currently working on a PR that will change all docker ENTRYPOINTs to run supervisord. Once this is tested and merged, I believe we should change all docker log drivers to 'syslog,' and eliminate the need to rotate more logs. I think we should hold off on merging this PR until we see what things look like at that point. |
@jleveque I think this PR is not blocking your work. It is general for all log drivers. |
@qiluo-msft: No, it wouldn't block my work. However, part of my PR is to consolidate process logs from inside docker containers to syslog. I just figured we could skip this PR and change the docker log driver to syslog also. It's up to you whether you want to merge this and revisit it again later. |
* src/sonic-utilities ee56d54...cb0e745 (11): > sonic_utilities: Support for DOM Threshold values for EEPROM dump (#545) > [portstat] Fix portstat show RX_UTIL over 100% for 100G (#563) > sonic_installer: fix read-only filesystem support for firmware update (#565) > Revert "show acl table command output should show binding column correctly even with single port (#447)" (#589) > show acl table command output should show binding column correctly even with single port (#447) > [config] Do no stop or restart dependent services (#582) > sfpshow: prevent 'show int trans eeprom --dom' from crashing (#567) > [warm-reboot] add docker upgrade --warm option and roll back support (#559) > [ecnconfig] Validate input WRED parameters (#579) > [sonic-utilities] Add fstrim to reboot (#535) > Fixing the expected neighbor command due to change in output format under sonic-buildimage/pull/3036 (#584)
When calc the RX_UTIL, currently it use hardcode 40G, now change to get the real port speed via APP DB Signed-off-by: Richard Wu <wutong23@baidu.com>
add acl table created by dtel to acl default tables
54879741 [202012][schema] Add vnet route tunnel and advertise network tables for state_db (sonic-net#563) a5394f9d Update for BFD, default route table (sonic-net#550) Signed-off-by: Stephen Sun <stephens@nvidia.com>
No description provided.