I'm trying to configure a LAMP server. Actually I opted for Nginx but I guess it's irrelevant to the topic. The server is to be used as a wordpress host. I'm planning to use APC to fully cache pages (APC Object Cache Backend and Batcache plugins).
My question is not about the amount of RAM installed into a machine but about the proportion of RAM allocated to each component of the LAMP (or LEMP) server. I'm asking this because every article that I've found on memory configuration says the same:
- allocate all available memory to <put the name of the component here>
I have the following components that compete for RAM:
- Nginx
- php-fpm
- Percona MySQL
- APC
Something tells me letting these processes compete for the memory is a bad idea. They need to know their limits.
I understand that the actual memory allocation may depend on the website usage but is there a proportion for starters? For example, allocate 20% to MySQL, 40% to APC, 20% to php-fpm, leave the rest to the system?