How to reduce memory usage per virtual server
-
On CentOS 5.8/Apache 2.2.3/FastCGI/PHP 5.3.10 virtual machine I have the original and a cloned Magento install (to be used as a staging server). I would like to minimize memory usage by apache and php on this staging server ONLY and I'm looking for recommendations on how to do this. For example, I want to know if its possible to set limits like prefork MPM/worker MPM on a single virtual server. PHP memory_limit is already set to 128M, as that is the minimum Magento needs to run. Thanks
-
Answer:
Your memory limits need to be the same on your development/staging environment as on your live site - otherwise a script which works on one, will not work on another. So reducing any memory allocations would not be wise. If you are using the same server for both development and production stores - separation via VPS seems a little peculiar (if you are trying to keep memory overheads to a minimum) as you will encourage additional RAM usage simply to run a duplicate of every service? It would make more sense to run your staging site on the same VPS as your production store, running the PHP instance as another user that has specific limits set in /etc/security/limits.conf - then you can prevent runaway memory usage, number of processes and anything else. If you truly need resource and platform separation (ie. for PCI DSS compliance or even just best practice), then in your staging/dev VPS, simply set a maximum of 1 Apache thread. If you are the sole developer, there will only need to be one process/spawn running. But ultimately RAM is exceptionally cheap - just buy more. Don't constrain your application or try to run twice as much with half what you should have.
Gaia at Server Fault Visit the source
Related Q & A:
- How To Reduce Fat?Best solution by Yahoo! Answers
- How to reduce size of PDF export?Best solution by wikihow.com
- What's the relationship between .NET assembly file size and memory usage?Best solution by Programmers
- How to estimate water usage?Best solution by swfwmd.state.fl.us
- Why is the maximum memory usage 512?Best solution by answers.yahoo.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.