Reducing memory use in a CakePHP application
This weekend I sat down and tackled the RAM problem: the amount of memory it takes the server to generate a single page of a website.
For Backboard, we have our server set up to allocate just 16 MB of RAM to PHP for the execution of each request. This allows us maximize the number of Apache processes we can run on a single server and thus maximize the number of users we support. To do this, though, means that the site has to be pretty light on its memory requirements.
Backboard, as a CakePHP application, has a theoretical minimum requirement for RAM: namely, the amount needed to execute a base installation of Cake. In our testing, this falls between 4 and 6 MB. The goal, of course, is to minimize anything above and beyond this.
Here are some concrete steps you can take to limit the RAM needs of your site:
