Why server becomes slow after high traffic and back to fast after restart?
I noticed that my dedi server becomes slower after high traffic. But when i restarted apache, the speed goes back to normal (fast) and continues to stay fast for a long while, but gets slow again after 4 hours.
Restarting your Apache will usually kill all the running processes so new ones would start up with fresh new resources. Basically, your scripts (and/or Apache) are using either one of your CPU, memory, or disk in an excessive manner, so having further details should help us. Like XLHost mentioned, you should do a "free -mo" command while your server is running slow, and then another one just after restarting your Apache. Furthermore, you might want to check your load using the top command. A high value might mean that your scripts are using too much of your CPU, and that might mean incorrectly set up scripts, exploits, etc. A precise value of the Load item would also help us in providing additional information. Furthermore, you might also want to check the "wait" value inside top, as this would be the I/O wait, and a high value might signal a bottleneck with your disk drives being used excessively.
█ SlickWebHost::Quality Personal and Business Hosting Solutions
█ USA and UK, CloudLinux, LiteSpeed, R1Soft Shared Hosting
█ USA andUK Virtual Private Servers with Best Connectivity to Europe, North America and Asia
█ SlickWebHost::Non-outsourced 24/7 Support
It might be Apache holding on to connections longer than it's supposed, which ends up exhausting the artificial limits like the maximum number of connections. You'll need to lower the keep alive timeout and see how that helps. If this is a download site, increase the maximum number of clients but be sure you have enough memory.
Check to make sure your Logs are killing you. I dont know what kind of HTTP service your running with Apache but sometimes depending on what Apache has to do the log files get kinda long and hard to write and open