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

Enable local driver for log rotation #234

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

yanokwa
Copy link
Member

@yanokwa yanokwa commented Sep 1, 2021

Closes #231. For this PR, I verified that on the QA server...

  • docker-compose logs service outputs logs
  • sudo docker ps -qa | sudo xargs docker inspect --format='{{.LogPath}}' | sudo xargs ls -hl shows a reduction in log size
  • docker inspect <container> shows max-file as a config

As detailed at https://docs.docker.com/config/containers/logging/local/#options, this defaults to a 20M file for each log and 5 maximum files (each compressed).

In a 3 month period, we expect 15MB for service and 640MB for nginx for a very active server, so the defaults for 100MB for service (because it's less stuff in docker-compose) and 600MB for nginx seem like good conservative defaults. We can dial the latter down if necessary.

This risk of this PR is that we are possibly throwing away old logs and someone might find that objectionable.

@yanokwa
Copy link
Member Author

yanokwa commented Sep 8, 2021

@issa-tseng, per your suggestion, I looked into what version we would need...

Support for the local driver was added to docker-compose in v1.28.3 (docker/compose#8082).

We recommend this DigitalOcean droplet which runs docker-compose v1.27.4, so we should add docs for v1.3 that people need to upgrade their docker-compose.

Instructions are at https://docs.docker.com/compose/install/ and I can confirm it works on the droplet.

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

We use v1.29.2 on ODK Cloud and it works great.

@yanokwa yanokwa mentioned this pull request Sep 8, 2021
3 tasks
@matthew-white matthew-white changed the base branch from master to release September 22, 2021 20:35
@matthew-white matthew-white merged commit f197e5a into getodk:release Sep 22, 2021
@matthew-white matthew-white mentioned this pull request Sep 22, 2021
@yanokwa yanokwa deleted the add-log-rotation branch November 18, 2021 17:11
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.

Container logs can very large and should be compressed
3 participants