You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though I don't know yet how we'll implement this, we'd like to — as part of the provisioning process — calculate a php memory_limit and several apache directives, based on the server's total RAM capacity.
Our target machine for a genesis install would have 2GB or more, while the local vagrant machine currently is allocated 1GB.
Note: I'm assuming #53 would mean Vagrant's memory usage would be negligible and roll into the overall system reserved memory.
First, we should calculate memory set aside for specific non-apache uses. I'm thinking the following:
System reserved memory: 512M for a machine with 2G or more, otherwise 1/4 of total system memory
MySQL reserved memory: 512M for a machine with 2G or more, otherwise 320M
PHP memory_limit: 256M for a machine with 2G or more, otherwise 128M
And apache-specific settings:
StartServers: 5 for a machine with 2G or more, otherwise 2
MinSpareServers: 5 for a machine with 2G or more, otherwise 2
MaxSpareServers: 10 for a machine with 2G or more, otherwise 3
MaxRequestsPerChild: Pulling a figure out of thin air, but I'm thinking 5000 should work?
Since the php memory limit is an upper limit and applies to each individual apache child process, we could probably safely halve it for the MaxClients calculation
MaxRequestsPerChild
5000 should work well when using 16Gb of ram, I would divide that number when scaling down memory
16Gb - 5000
8Gb - 2500
4Gb - 1250
2Gb - 1000 ( I know is not 625 but the number works well on this one too , I've tested it)
what we don't want to do is leave it at 0 (default values) I have read that 0 tends to keep the Max Request in memory causing memory leaks in application and crashing apache, from note on the internet
Activity
EvanK commentedon Nov 8, 2013
Since the php memory limit is an upper limit and applies to each individual apache child process, we could probably safely halve it for the MaxClients calculation
EvanK commentedon Nov 8, 2013
/cc @epitty1023 @danieljgraves
danieljgraves commentedon Nov 8, 2013
Good work. I agree!
epitty1023 commentedon Nov 8, 2013
MaxRequestsPerChild
5000 should work well when using 16Gb of ram, I would divide that number when scaling down memory
16Gb - 5000
8Gb - 2500
4Gb - 1250
2Gb - 1000 ( I know is not 625 but the number works well on this one too , I've tested it)
what we don't want to do is leave it at 0 (default values) I have read that 0 tends to keep the Max Request in memory causing memory leaks in application and crashing apache, from note on the internet
Calculating php memory_limit and apache prefork directives; allowing …