PHP unable to allocate memory

Solution 1:

That is definitely the error you get when APC runs out of memory. When I (re)build servers, I often forget to increase this value to 128 M (suitable for my application) and that is the exact error you see.

Solution 2:

Any failcounts in /proc/bc/resources?

All failcounts should be 0 or stay same since the last incident.

You need to:

  1. Increase the resource limits with vzct set <CTID> ... --save on the resources that have fail counts (see man vzctl the set section). You can also modify the resource limits directly in /etc/vz/conf/. Probably in all cases you need to reboot the containers after increasing the limits.

    To be safe, increase the settings (both barrier and limit) for problematic resources to x2 (twice) the maxheld.

  2. Write down the current fail counts and keep an eye on them so that they don't increase any more.

For more info on controlling various resources, you can use http://wiki.openvz.org/Resource_shortage as a starting point.