Score:0

Apache httpd low performance

ae flag

I have an website which is running using httpd on Centos 7.

I have 8 cpus and 32 GB ram.

When we have more than 500-600 users in the same time on the website, the server response is getting higher. Even that, cpu load is about 20-25% and RAM is also not used.

What can we configure in order to increase the performance or what I am missing? Our pages are 100% cached and we do not run database queries or anything like that.

httpd.conf

HostnameLookups Off
KeepAlive On
MaxKeepAliveRequests 1500
KeepAliveTimeout 5
<IfModule prefork.c>
   StartServers        30
   MinSpareServers     30
   MaxSpareServers     50
   ServerLimit      512
   MaxClients       512
   MaxRequestsPerChild 10000
</IfModule>

top:

%Cpu(s):  1.9 us,  2.6 sy,  0.0 ni, 95.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 32779548 total,  3268520 free, 12679060 used, 16831968 buff/cache
us flag
Does this answer your question? [How do you do load testing and capacity planning for web sites?](https://serverfault.com/questions/350454/how-do-you-do-load-testing-and-capacity-planning-for-web-sites)
us flag
These kinds of performance related questions cannot be answered in format like this. There are simply too many variables, so only possible answers are guesses. The only valid approach is explained in the question above.
George Carpiti avatar
ae flag
I just asked about apache issues, nothing else. I don't know if my settings are in order.
us flag
Without knowing the full setup and software, it is impossible to give any advice. Your Apache2 settings might be optimal or not optimal, but all of that depends on the entire system. Most likely Apache2 has the least effect on performance. Only valid approach for performance issues is the quoted answer.
George Carpiti avatar
ae flag
Tell me what you need and I can share any details. Thx
us flag
What is the website application? What does "our pages are 100% cached" mean exactly?
George Carpiti avatar
ae flag
We deliver only static content, if any page is accessed we do not run any query on our database.
George Carpiti avatar
ae flag
Our issue is that we do not have any issue with RAM/CPU but when the load is higher, the response time is getting higher.
Score:0
iq flag

Apache is pretty darn efficient. Although technically should qualify my answer, it's almost certainly something else that's bogging you rather than the server itself.. probably the CGI you're running or something completely different.

You probably want to start by running top to see what programs are actually using up the resources and then take it from there, perhaps asking more questions while posting what you see.

The only vaguely-likely examples I can think of where Apache will really stall out are:

  1. If you're somehow making it go recursive - you know - doing redirects from one URL to the same URL and then again and again and again...

  2. If you're using domain names in your configuration that aren't resolving. Maybe they're spelled wrong or expired or your DNS is messed up. Minor misses are ok, but some configurations could attempt many failed dns-lookups on every hit.

It looks like your CPU(s) are still pretty idle, so it's probably waiting on some DNS or a system-problem or whatever.

"kdump" can really get into the nitty gritty and see what's going on, but start with looking at the rest of "top" (or ps -axww) to what programs are actually using up your system resources rather than just assuming it's apache, because it may or may not be apache itself that's the problem.

I sit in a Tesla and translated this thread with Ai:

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.