Does having a large access log file hinder performance? What is an appropriate file size limit for Apache2 logs? I have log rotate running in cron daily, and the limit is 52 MBs, but this is run once a day and the log file is getting to about 200 MBs before the day is done and the log rotates. Should I have log rotate run a couple times through the day to rotate more often, or is this file size not going to hinder performance enough to bother with this?
Asked
Active
Viewed 253 times
1 Answers
1
I don't think having a large log file will cause a performance hit to apache. It uses handlers that simply append messages to the end of the file. The thing you do want to look out for, however, is your partition becoming full.
If you really needed to, you could create a special cron task to run logrotate against your apache2 logrotate configuration a few more times every day:
sudo crontab -e
4,8,12,16,20 * * * * /usr/sbin/logrotate -f /etc/logrotate.d/apache2

Tyler Henthorn
- 581
- 5
- 12
-
Yea, that's what I was thinking, but I just thought it might be something of concern if it was 4 times the size of what was intended for logrotate by default. You are correct, however, the log file size does not hinder performance for a simple appendage of text to the end of a file. When I open with VIM, it takes a while to scroll to the bottom of all that text, but simply appending, it doesn't need to process what is already in the file, just add to the end of the file. I just wanted to make sure there wasn't any other issues with this file size. Thanks. – Furbeenator Mar 03 '14 at 17:18