Is there a way to limit the total (not per process) memory Apache uses?
I have a web server that runs PHP and MySQL. I need a PHP memory limit of 1G or some scripts will fail (dompdf/phpexcel). The problem is that sometimes people run those scripts at the same time. Apache uses several GB of memory and MySQL is the one that dies due to lack of memory.
I want to limit it to like 4 GB, so that if 5+ of those scripts are called simultaneously, they fail to run.
I took a look at RLimitMEM, but it is per process.
I use Apache 2.4 on Centos 6 with event MPM.