How to minimize memory usage on LAMP? Virtual dedicated server, max 512 RAM, 20 GB drive space, it should run a Wordpress blog. Not sure for load, but lets say 2-5k visitors per day.
feedback
|
|
If you're really into memory saving, you'd probably be better of replacing LAMP (Linux, Apache, MySQL, PHP) with LLMP (LigHTTPd instead of Apache) or even better LLSP (Linux, LigHTTPd, SQLite and PHP). | ||||
|
feedback
|
|
At a maximum of 5k hits a day, that works out to just one query every 10 seconds. Not a huge load. Although RAM is the constraining factor, you can probably get away with beefing it up with swap, given the very low volume of traffic you are expecting. Still, trimming out some fat will go a long ways towards your goals. I've done some work with low-memory servers, but that was a long time ago. I'll try my best to remember. Here it goes:
| ||||
|
feedback
|
|
This link has more information, than all received answers together:) http://wiki.vpslink.com/Low_memory_MySQL_/_Apache_configurations | |||
|
feedback
|
|
Don't run X, shutdown all unneccesary services, and compile Apache, MySQL, and PHP with only essential functionality. | |||
|
feedback
|
|
For trimming apache itself, look at the modules that you are loading. There are some good other answers on here for general memory and load reductions so take those into account as well. It's hard to know exactly what would be good to turn off but a few recommendations I would make are: *auth_digest_module* - most browsers don't support this form of authentication so it is unlikely you would be using it. *ldap_module*, *authnz_ldap_module* - if your not authenticating against ldap or anything based off of ldap these aren't needed. Note: PHP might depend on this if your using it's ldap functions. I've never tried turning these off when I was using those functions. *userdir_module* - this might already be turned off and should be on any production website anyway *speling_module* - this one is tricky. If you turn this off your url's are case sensitive. Supposedly this also "corrects misspelled urls" though I've yet to see this actually happen. If your client-base types in the urls, I would leave this on otherwise it's probably safe to turn off. Apache has a lot of documentation on their modules. I would recommend going through it and after reading the documentation on a modules decide if you need it but only if you completely understand the module. Some of them provide very important core functionality and can break other things by not being available. | |||
|
feedback
|