jeudi 17 mai 2018

Rails logger not release log file even after delete log file it keep taking space on disk

I have multi-threaded rails application and it has many workers which pull a message from resque queue and logs messages. I have put linux logrotate to rotate log and after log rotate it upload to S3.

but after uploaded and delete file I see disk space still used not release
when I execute below command i see lots of files.

lsof | grep deleted
ruby      14530           fadmin    7w      REG              202,1 1972144092  407325 /home/fadmin/www/fasterap/shared/log/production_database.log.1 (deleted)
ruby-time 14536 20352     fadmin    7w      REG              202,1 1972144092  407325 /home/log/production_database.log.1 (deleted)

it full diskspace every time it release space only if I kill all ruby process.

can I know what best way to rotate logs and how should I avoid the problem?

Aucun commentaire:

Enregistrer un commentaire