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

Rotator creates log file that fills drive to max #165

Open
Terhiman opened this issue Oct 2, 2020 · 1 comment
Open

Rotator creates log file that fills drive to max #165

Terhiman opened this issue Oct 2, 2020 · 1 comment

Comments

@Terhiman
Copy link

Terhiman commented Oct 2, 2020

When the log-rotator hits rotate time it maxes out cpu and memory and creates a log file that completely fills the logs drive (in this case 27Gb). The whole machine grinds to a halt.

I have had to disable it. Even though I have deleted all of the offending log files the 27Gb space is not freed.

log-rotator is process zero in pm2 and I did pm2 stop 0 possibly this has locked the main log file?

@mjy78
Copy link

mjy78 commented Oct 28, 2020

Experienced this on our production environment overnight as well. Have a max_size of 1G. It looks like logrotate created a copy of the log when it reached this size, but then didn't (or couldn't reset the main log) so the main log just kept growing and logrotate kept creating copies of the log until the file system was out of space.

My settings are as per below:

$ pm2 set pm2-logrotate:max_size 1G
$ pm2 set pm2-logrotate:retain 30
$ pm2 set pm2-logrotate:compress true
$ pm2 set pm2-logrotate:dateFormat YYYY-MM-DD_HH-mm-ss
$ pm2 set pm2-logrotate:workerInterval 300
$ pm2 set pm2-logrotate:rotateInterval 0 0 0 1 * *
$ pm2 set pm2-logrotate:rotateModule true

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

No branches or pull requests

2 participants