Page MenuHomePhabricator

Avoid thumbor generating log files > 1GB
Closed, ResolvedPublic

Description

If we're rlimiting the thumbor process from creating files bigger than 1GB, it applies to log files as well. And currently production log files can be bigger than the 1GB limit. We need to see if there's a way to configure python logging so that it would roll over not just based on date but also when log files go over a certain size.

Event Timeline

Change 320273 had a related patch set uploaded (by Gilles):
Rotate Thumbor 404 log by size, not date

https://gerrit.wikimedia.org/r/320273

Change 320374 had a related patch set uploaded (by Gilles):
Upgrade to 0.1.29

https://gerrit.wikimedia.org/r/320374

Change 320374 merged by Filippo Giunchedi:
Upgrade to 0.1.29

https://gerrit.wikimedia.org/r/320374

Change 320273 merged by Filippo Giunchedi:
Rotate Thumbor 404 log by size, not date

https://gerrit.wikimedia.org/r/320273

The size-based rotation appears to be working fine:

gilles@thumbor1001:/srv/log/thumbor$ ls -alh
total 2.3G
drwxr-xr-x 2 thumbor thumbor 4.0K Nov 14 09:36 .
drwxr-xr-x 3 root    root    4.0K Oct 18 14:44 ..
-rw-r--r-- 1 thumbor thumbor 431M Nov 14 09:36 thumbor.404.log
-rw-r--r-- 1 thumbor thumbor 901M Nov 13 07:11 thumbor.404.log.1
-rw-r--r-- 1 thumbor thumbor 901M Nov 10 13:02 thumbor.404.log.2
-rw-r--r-- 1 thumbor thumbor    0 Nov 10 13:02 thumbor.404.log.lock