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?
MaxClients: the greater of these two:
($TotalMemory - $ReservedSystemMemory - $ReservedMysqlMemory) / $PhpMemoryLimit
- The number of vcpus the machine has
Thoughts?
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_limitand 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:
memory_limit: 256M for a machine with 2G or more, otherwise 128MAnd apache-specific settings:
StartServers: 5 for a machine with 2G or more, otherwise 2MinSpareServers: 5 for a machine with 2G or more, otherwise 2MaxSpareServers: 10 for a machine with 2G or more, otherwise 3MaxRequestsPerChild: Pulling a figure out of thin air, but I'm thinking 5000 should work?MaxClients: the greater of these two:($TotalMemory - $ReservedSystemMemory - $ReservedMysqlMemory) / $PhpMemoryLimitThoughts?