This question might be a bit long and specific, but I have been attempting to find conclusive answers to the following questions for about a month now and I have yet to find decisive information. A question as specific as this is hard to generalize and if I would have come across a similar question it would have been informative even if the specific server configurations would've differed from mine.
My server is a VPS running cPanel (WHM) and PHP mode is SuPHP. The server has 768MB of RAM and hosts about 12 websites. Some are quite memory intensive whereas other hardly use any memory or cpu at all.
I have recently installed a Magento store for one of my customers and have since been experimenting with different settings to achieve performance gains. Nothing really helped until I installed xCache and configured PHP to run as FCGID or DSO (because xCache will not work with SuPHP). This configuration boosted performance by 2/3 (meaning pages loaded about 3 times faster).
The only setback was that after a few minutes, the server ran out of memory and I had to hard reset it. So now I'm back to SuPHP and things are fine.
Even if I disabled xCache and only left FCGID or DSO mode instead of SuPHP, the server ran out of memory in about 30 mins or so. The culprit, therefore, seems to be PHP running as anything else then SuPHP.
I also noticed that my memory usage went way up when I opened a new front-end URL from a different WHM-defined user, but the usage seemed to remain fairly constant when I opened up multiple URLS from the same WHM user account.
To the point then:
- How can I make sure PHP + xCache keep running stable? Or do I just need to buy more memory?
- What are the differences in memory usage between SuPHP, DSO and FCGID? Is it possible to tweak this by changing some php.ini vars?
Also, I'm contemplating to update some of my other servers to use xCache. What configuration of settings and PHP mode (SuPHP, DSO or FCGI) and xCache would you recommend for the following servers?
- Quad core @ 2.4Ghz, 4GB RAM dedicated server with 1 huge Magento store, with cPanel and WHM
- Quad core @ 2.4Ghz, 8GB RAM server with some 20 large Magento stores, with cPanel and WHM
- Quad core @ 2.66Ghz, 8GB RAM server with 100+ Joomla-like websites, with cPanel and WHM, also acting as e-mail server with mailman enabled etc.