Created
June 28, 2012 11:20
-
-
Save croxton/3010749 to your computer and use it in GitHub Desktop.
Apache config for VPS with 2Gb Ram running nginx as a reverse proxy for static files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| My Apache config for a VPS with 2Gb Ram and the following: | |
| * CentOS | |
| * cPanel | |
| * Apache 2.x (MPM Prefork) | |
| * Nginx as a reverse proxy for static files (Nginx Admin cPanel plugin) | |
| * APC, or eAccelerator for opcode caching | |
| * One or multiple ExpressionEngine websites | |
| min spare servers 2 | |
| max spare servers 5 | |
| - should be roughly double min spare servers | |
| start servers 2 | |
| - should be same as min spare servers | |
| server limit 50 | |
| - 20Mb-30Mb per process so 50x30Mb=1500Mb, or 75% of available ram; go lower if your page loads use more memory. | |
| max clients 50 | |
| - same as server limit | |
| max requests per child 500 | |
| - ~10x the max clients. Ideally should be much higher (up to 5000) but experiment; higher means more chance of memory leaks. | |
| KeepAlives Off | |
| - on a VPS keep alives may cause the server to start swapping if it is hit with bursts of traffic | |
| e.g. by an aggressive distributed web crawler. I'm looking at you 80legs.com. | |
| Additional: | |
| * check your php.ini and set the lowest memory limit possible. Make it no more than 4x the typical page load. | |
| memory_limit = 128M |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment