I have a 1GB VPS server running 12.0.4 ubuntu. Everything works just fine, most of time my RAM usage shows around 700 MB. However every week or so at random time Server goes out of memory and crashes. It recovers and start all service except Mysql.
I found that I don't have swap memory, so I create 256MB swap file and configure it. It works fine, but still crash this time after 2 weeks.
I am no expert as you already figured it out. So, I want some guidance on why in normal operation my server is taking so much Memory. I mean I observe it at different time, it is always around 700-800MB Memory and Load is stable. there is not cron that run at night or something. I have couple of wordpress blog
, but they have stable load and never see any "bulk" load.
I do have Vesta Control Panel, and all reports are normal that I know off. One thing that however I notice is that Apache always shows 1900MB of Memory consumption where as my system in total have lower memory. I have nginx installed reverse web server[not sure what does that mean by vesta did it for me]. everything else is good just apache is all the time at 1900MB. and it seems that when this usage increase it crash the server.
So, is there a way I can bring down that usage of apache? What else are measure I should do to make my server stable with current load.
EDIT:
Based on suggestion here is my MPM Configuration
<IfModule mpm_prefork_module>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 200
MaxRequestsPerChild 4000
</IfModule>
and here is my apache2ctl -l
Compiled in modules:
core.c
mod_log_config.c
mod_logio.c
prefork.c
http_core.c
mod_so.c
Though I mention before, but I am running Wordpress (PHP) based blogs on server, there is Redmine
(Ruby on Rail) as well that runs using Nginx and apache in same way as other website. No, i don't use python.