I have been having this problem for months. I have a webhosting server and from time to time, every submit of any PHP form hangs. There are no errors in the log and I have updated all packages over the previous months. I even created a brand new chroot with all packages compiled from scratch and installed a new kernel but nothing helps. It seems random, sometimes the server can last for a couple of weeks without any problem but then there are days when it happens several times. It used to be worse when I had the worker MPM, I have switched to prefork in the meantime. That helped a bit but did not solve the problem. I have also tried decreasing the max requests per child directive, in hopes that if PHP leaks or hangs, the process will get restarted more frequently, solving the problem. But it did not really help either.

Now I do not know what else to try or where to look. Any ideas would be appreciated.

Also I found out that very simple PHP scripts do not hang on POST - but when it comes to opening wordpress sites or sending some support tickets, etc., it becomes very slow - top shows nothing, Apache seems to be sleeping and not using CPU at all.

When I check the log while it is stalling, it shows nothing. The corresponding line in the log appears only after the page has been successfully downloaded but it shows the correct time (when I sent the request).

Is it possible that the bottleneck is your MySQL server? For example it might be that slow queries on a large data basis cause MySQL to have too many open connections, and (depending on its configuration) it waits until a new slot is available.

What types of PHP applications do you have installed? In your WordPress installation(s), what plugins do you use? Did you try deactivating them? Sometimes they are horribly coded and cause the weirdest problems._________________lxg.de – codebits and tech talk

MySQL is not the bottleneck, it is not doing anything when this problem occurs. Also, there are not many open connections to the database.

The biggest problem is that it is a webhosting server and I have no control over what my customers are using. I cannot just go and disable some wordpress plugins in their installation. Unfortunately, this makes it really difficult to trace the root of the problem. I am quite sure that something must trigger it, some weird PHP script one of my customers is using, a wordpress plugin, something like that. On the other hand, since I am using apache/prefork, the processes should be isolated and even if one of them slows down, the rest should work normally.

The biggest problem is that it is a webhosting server and I have no control over what my customers are using.

Yup, what you're experiencing are the common problems of a virtual hosting provider. Unless you're offering real virtualization and resource provisioning, one customer can drag the entire server down.

Are you using Munin? If not, you should really consider installing it. If you already have it, I would recommend to assign virtual identifiers to your customers and monitor their ressource usage. For example, as for Apache, you could set up virtual, internal IP addresses (one for each vHost) and assign a Munin sensor to each of them. I think there are Munin plugins to monitor virtual hosts directly, but I don't know how they perform. Same for MySQL etc. You can even write your own sensors, it's not that hard._________________lxg.de – codebits and tech talk