You can use a cronjob to restart apache every 12 hours or every 6 hours, it's up to you.
The command line for a graceful apache restart is apachectl -k graceful..
So where do I go to do this? sorry i'm very new to WHM...
And, what actually happens when apache restarts? I mean, why does this speed up the site? And what causes it to slow down? Im just interested in hearing what actually goes on from a servers perspective..
To be honest I've never dealt with WHM but I'll get to play with it tomorrow. I finally ordered a reseller's account so I'll see what the fuss is about..
That said I don't know (yet) where to run the command in WHM because I have no clue what it looks like.
But what I can do is give you a brief understanding of what happens behind the scenes..
There are two ways to restart Apache. A graceful restart is the preferred method, because it won't disconnect any existing connections. Say for example a user is downloading a file and you do a hard reboot, any requests in progress are terminated. A graceful restart will keep that download running..
In general the way Apache work is by starting child processes that handle requests. The more people visit your site, the more children it starts. Each child can handle a maximum amount of connections before the parent spawns another child. When you have too many children processes running, you run out of memory..
It's hard for me to tell you why it slows down your server. You may have too many child processes running, or in other words you have too much traffic and need a faster server. Then again you might have a memory leak somewhere. Is this a dedicated box? Is it a datacenter or are you leasing it? If you lease, I would ask support to take a look at it for you while it's at it's peak...
Thanks for the explanation. I am currently on a dedicated box... hosting almost 19 sites in total. The majority of the time things are fine.. but it's just the odd time where I'll log on and notice that things are slower than usual... so I'll go into WHM and restart Apache, which makes everything run fast again.
So it would be great if Apache just automatically restarted every 12 hours or so... did you manage to get your reseller account up and running?..
Yep. Im browsing around WHM but it's still a little new to me. It's not a dedicated box so I dont get a shell account, and Im used to seeing the terminal..
I'd send them a quick email and see what they say, they should be more knowledgable than I am...