As I know, a static way to adjust memory usage is by tuning the prefork parameter. More specifically, we can change the MaxRequestWorkers directive in the mpm_prefork module.
Also, the other link says that using mod_perl can set the memory limit per child process.
However, every time you change the config, you need to restart the apache server.
Q1. Is there a way to do it without restarting apache?
Q2. Tuning the mpm_prefork is an internal approach. It relies on the apache process to self-regulate itself. Besides, we need to determine the size of the average Apache process.
I was thinking of an external approach. Can we regulate it in the OS process level. For example, we set a hard limit (e.g., 400MB) on the resource usage of the apache process group. I have never done it before. Can anyone point me how to do that?
P.S., I'm aware this 'external' approach may be ugly and may cause apache to crash. Just curious if such a way exists.
Aucun commentaire:
Enregistrer un commentaire