Do you happen to have a really bad uptime for PHP’s APC, and it seems to randomly restart after 2 hours or so? Well, chances are that you are running cPanel/WHM on this server as well?
The problem is that you need to enable Piped Loggin for Apache. This can be found under Apache Configuration in WHM.
It says:
Configure Apache to use a single log target for all virtual host access and bandwidth logs. The combined logs will be piped to a helper application where they can be split based upon domain. This option will reduce the number of log files Apache manages freeing up system resources. Piped logging is recommended for systems with a large number of domains. By default this feature is disabled, and Apache will create distinct log files for each virtual host entry.
Once you do this, your log files will be processed (it defaults to every 2 hours), without APC restarting. For even more information, head over to this post on the cPanel forums.
This problem is obviously very frustrating and it took me quite a while to dig up the solution. Hopefully this helps others out there.
5 replies on “APC Uptime Restarts Every 2 Hours”
I’ve been searching for a solution for his problem forever. It can’t possibly be that easy. I just now enabled piped login and now I’m watching. I’ll let you know. Thanks!
Nope, didn’t work. Thanks anyway.
Sorry to hear that. Did you restart Apache after the piped logging was enabled?
Also, to test that its logging, try to change the default split logging time of 2 hrs to 3 or 4 and see what happens.Server Configuration >> Statistics Software Configuration
Bandwidth Processing Frequency
Yeah, it’s set to every 24 hours actually. And I don’t think any of the stat programs are even enabled. APC is flushed about every 45 minutes. I’ve tried everythiung. Someone said it might just be a shortcoming of using APC with a CPanel server.
This worked like a charm for me, thanks!