-
Notifications
You must be signed in to change notification settings - Fork 445
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
Docker container logs fill up disk space on production servers #1014
Comments
Indeed, our implementation of the platform seems to produce quite large amounts of logs, both platform logs and docker container logs. In particular, our container logs are about 48.5G in total and they have increased about 4.5G the last 3 days. The 4 containers with the largest log files are:
We currently use the Palm.4 release and our databases are about 56GB for MySQL and 21G (about 53G of actual data size) for MongoDB. I should mention that we started using the Palm release after we transferred from Lilac (Lilac was a native installation, no tutor/docker) a few days before Christmas, and this was our first time using tutor with docker, so obviously the almost 50G of container logs were created the last couple of months. I can keep an eye on the rate with which the logs increase daily and post it here if this will help. |
Thank you for these details Dimitris. I believe you also have an issue with the "all.log" and "tracking.log" files, right? In your email to me, you estimated that they used about ~1GB/day. This is a data point that will be useful in crafting an adequate solution. Finally, can you give us a sense of your number of daily active users (DAU), such that we can make a recommendation that makes sense for most people? |
Yes, exactly, I didn't include those because the issue mentioned docker container logs. The platform's (our Open edX, palm.4 release) log files were about 62G (32G and 30G for "all.log" and "tracking.log" respectively) in total from a couple of days before Christmas when we first setup our Palm release, up to about 4 days ago when I moved them elsewhere and they started from zero bytes.
In our platform we have about 127000 active users (meaning, they have enrolled in one or more courses and often interact with the platform). |
Quick update concerning the Docker Container logs!!! A few days before we discover the problem with the disk space I had installed and enabled Cairn, but disabled it just to gain a bit of disk space thinking it might help. A few minutes ago, I again enabled the Cairn plugin (so to get some more accurate metrics), and run "tutor local launch". The only big one that remained the way it was before, is now the log in the "/tutor_local-caddy-1" container with current size of 19.1G. I am not very familiar with how docker works, and if this is somehow related with the re-enabling of the Cairn plugin or it was just the "tutor local launch" that helped (although I had run it before and it didn't change much in terms of disk space and container logs), but I thought it's an important development that might help a lot! |
Dimitris, given that you have a large platform with many active users, I strongly suggest that you automatically log-rotate Docker logs by configuring the Docker daemon, as documented here: https://docs.docker.com/config/containers/logging/configure/#configure-the-default-logging-driver It should be as simple as modifying the /etc/docker/daemon.json file. If this works for you, then we should definitely add these instructions to the Tutor docs -- e.g: in the scaling tutorial. |
@regisb thank you so much! I will try this, let it there for a few days and let you know how it goes. |
While the configuration is indeed very simple, it doesn't seem to work for containers already created... I also found a comment on docker's forums that confirms it: This person though proposes the emptying of the log file manually. |
I'm guessing you should try to delete existing containers, with something like:
Or alternatively:
|
I was a bit afraid doing that actually, thank you though for the suggestion, I will try this now :) |
Thank you @regisb this actually did the job, the container logs are starting now from scratch, I will keep an eye on them to see if they now rotate properly and let you know so to put this method to the Tutor docs, I bet it will be useful for lot of people! |
The logs are rotated correctly in my test platform after setting up the In production though, after I run
Nevertheless, after I run That helped me claim back about 50G of disk space which is quite helpful considering these particular logs were increasing by about 1 to 1.2G per day!
I think now it's safe and useful to include these instructions to tutor docs, I am sure many people using the platform will use it! |
Let's keep this issue open then. To close it, we will have to add some instructions to the scaling tutorial. |
Someone else facing this issue: https://discuss.openedx.org/t/docker-container-logs-taking-up-a-lot-of-disk-space/14272 |
Bug description
In Open edX platforms that run for a long time (with
tutor local
), the Docker containers output logs that gradually fill up the disks.How to reproduce
Run Open edX for a long while, run
df -lh
.Additional context
I'm not sure if this is an issue or a feature that we want to keep in Tutor. We could configure all containers to log-rotate logs (with these options). But it might be important for some platforms to preserve logs for a very long time. Moreover, users who want to enable log-rotation can do so by configuring the Docker daemon (see this).
At the very least, we should document how platform administrators can enable log rotation on their server.
The text was updated successfully, but these errors were encountered: