I have been trying to research domlogs on google and can not really find the answer I am looking for. I want to know the specifics on how we can rotate domlogs. My server will always get really slow at times and I want to have the best settings so my server is not so slow. I think I need to rotate the files more then once a day.
As far as I know log rotation will do NOTHING for speed of your server. Apache doesn't read the old logs, it simply appends to the end of them. It doesn't care whether they're 10k, 100k or 100mb - it just appends the lines on the end with a system call that opens the file at the end and sticks the line on. I'd look in other places to optimize your server.
That's probably due to the log reporting tools (eg awstats) taking longer to process them. Or something similar; I'd be curious to know. Have you checked to see what processes are running when your server is slow?
You disagreement aside, I can't beleive Apache itself would run slower. The file append that apache uses to write to logs doesn't read the existing file, it simply places the new lines at the end. That's why I suspect log reporting.
Would be interested to hear if others have noticed a performance improvement after removing logs!
As far as I know log rotation will do NOTHING for speed of your server.
Having more than 2g worth of logs CAN, in fact drastically decrease your site's load time. I've had countless customers come up to me and say "Apache loads slow", and as soon as I clean out these log directories (or move them elsewhere), boom, it's back to normal. Even a restart doesn't usually help here.
Keeping log files as empty as possible helps with this. Yes, you want things accessible to customers, but you also want your server running smoothly. Keeping your logfiles as empty as possible is a great way to do this
WHMCS Guru - WHMCS addons, management, support and more. WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to WHMCS !!
Always looking for Linux, WHMCS, Support Desk work. PM for details
That was just "as far as I know". I'm curious here - if emptying the logs out makes a difference, there must be something in Apache that is reading the logs, or reading the logs directory.
I wonder if it's just the fact that an append to a file over a certain size means reading through a number of indirect blocks (from the inode) to find the end of the file? That seems likely to me, and if that was the case it would be sufficient to just rotate the log files for the large sites and that in itself would make a difference. Have you (or anyone else) noticed that?