I’m running an ecommerce website and it’s been running fine for a while now, but lately it keeps on crashing on me. It seems like the RAM gets exhausted on the server and then the server stops responding because RAM is at 99%.
I checked “netstat” through SSH and I see a lot of TIME_WAITED listings but not that many ESTABLISHED listing. I think this is either due to malicious crawling from bots or certain IPs that are attacking my website.
Is there a way I can check any logs to see what/who is actually causing my RAM to get exhausted?
You can use tools like
memstat to check your machine status and to confirm if it is really the apache process(es) which is eating up your memory.
You can look at the system logs
/var/log/syslog and apache logs. You may find some useful information there.
Also, you can try to reduce the number of these worker threads if you are spawning many apache processes.
It is not enough to look at the ESTABLISHED connections, you need to have an overall look at the connection in all states.
We may be able to give you a better answer if you provide us with more information.
Source : Link , Question Author : olimits7 , Answer Author : Khaled