Weekly logrotate causes websites to go down

7 posts / 0 new
Last post
#1 Sun, 08/25/2013 - 10:25
Hal9000

Weekly logrotate causes websites to go down

I would like to enable monitoring for all my websites, howevere there is a problem that needs to be solved first: whenever the weekly cron runs, which involves logrotating apache files with apache reloading for each site, the monitoring detects the site is down and sends an email alert. Also, I often get errors like "cannot fork" and the like. After a few minutes, everything is back to normal. Usually... Is there any way to avoid this? Also, I would like to enable monitoring but send the notification to me only, not to the domain owners. I don't want to be bothered each week about sites allegedly being down. Is this possible?

Sun, 08/25/2013 - 15:49
Locutus

This, especially the "cannot fork" part, sounds like the logrotation and Apache reload might use too many resources and run into trouble. Is there anything in the syslog at the time of rotation? Any error messages? Are you using an OpenVZ virtual machine maybe?

Mon, 08/26/2013 - 00:06
Hal9000

hmmm looks like the system ran out of memory and the kernel killed a few apache and php5 processes, which could explain why this sunday a couple of websites stopped working with no fcgi process slots left... i don't have the syslog of last week so can't see what happened there. maybe next sunday i just should stay awake and see what is going on

Mon, 08/26/2013 - 03:18
Locutus

Or you could instruct your log rotation to keep more previous syslog files. :)

Mon, 08/26/2013 - 06:40
Hal9000

Did that already, extended from 7 to 30 days :) I could also disable compression for the apache logfiles, that should lower the load a bit i guess, but then that would have an impact on the quota. Is there a way to exclude log files from quota calculation?

Mon, 08/26/2013 - 07:25
andreychek

Are you by chance using "writelogs"?

For example, what does this output:

ps auxw | grep writelogs

Also, what Linux distro are you using... is it by chance CentOS?

-Eric

Mon, 08/26/2013 - 13:33
Hal9000

no writelogs. i'm using debian 7.1

Topic locked