At certain times Apache is extremely slow and the problem is solved by restarting the server.
Checking "top" there aren't any unusual processes that take any extra resources. Also, when checking "iftop" the bandwidth isn't unusually high.
The problem is solved right after the command "service nginx restart" is run. It feels as though there is a while loop or something similar that slows the entire server down (10 seconds for loading 1 page).
Shouldn't however PHP's default timeout settings stop this from happening? My question is: what are the most common causes to a problem like this or how do I diagnose the issue and find out what the problem is?