Score:0

Why apache2 is using so much CPU power from a EC2 instance?

cn flag

This is my case: i have a ec2 instance with 5 virtual hosts running apache2. Sometimes, randomly, the CPU goes over 80% utilization because of apache. The sites are not so elaborated, and not even get so much traffic, thet're informative.

We thought it was a DoS attack, or a dictionary attack (for SSH). The instance has fail2ban and strong parameters in sshd.conf.

Is there any way to track exactly what's that process in apache? I've seen i'm not the only one having this problem with apache and ec2 instances

John Hanley avatar
cn flag
Without details in your question, we can only guess. I doubt that Apache is the problem. Why do you think Apache is using 80% of the CPU and not some other process or activity. Check that you are not running low on memory which will cause the system to thrash or swap to disk. Check free display space as well. You might be running a tiny instance that just cannot handle traffic spikes.
Score:0
bm flag

If the CPU goes over 80% utilization because of Apache, so the problem is with the apache, not the SSH or other service/app.

You can check apache2 access_log, If it has a huge size or contains a lot of traffic, then yes you are under DoS attack.

To prevent it, you can use WAF like Cloudflare or other services.

You are not give information about the server specification or the estimated traffic, so there is a possibility the problem is that your EC2 instance is under provision(need to upgrade).

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.