One of our clients has recently suffered continual problems with their Prestashop deployment and after finally getting to the bottom of the problem I thought I would share the information.
The site was running a commercial grade VPS with a separate database server, load balancer, and 3 front-end web servers (Cent-OS). We noticed that the web servers were continually failing for no apparent reason and the apache error_log was filling up with Segmentation fault errors:
[notice] child pid ###### exit signal Segmentation fault (11)
The CPU load was also extremely high on the servers, frequently spiking up to 100% and memory usage was also bizarrely high with each httpd instance taking up 120mb – 200mb or more. We raised a support ticket with our server vendors and we were advised to raised the MaxClient value in the php setting or add additional servers to the farm to help manage the load but our traffic was not THAT high and something clearly wasn’t right.
After repeated chasing (4 weeks worth to be exact) we eventually got hold of a decent engineer and he traced the problem back to the APC caching module for PHP and a conflict with Prestashop’s “smartycache”.
# ps -H h -ylC httpd | perl -lane '$s+=$F[7];$i++;END{printf"Avg=%.1fMB\n",$s/$i/2048}'
And then diving this into your main memory on the server (replace 2048 in above command). Don’t forget to leave some memory for your OS though so subtract 500mb-1024mb from your main memory depending on what else is running on there.
I hope this helps someone