Hi I am getting approx 300 to 400 hits every second. Apache is struggling to handle this. The site is very slow in loading. How to improve the performance of httpd? Thanks
Well, what kind of hosting have you? Shared? VPS? How big are your files? Any big images to load? Heavy scripts? some more info please
Dedicated server. i7, 8gb ram It was working good yesterday. Today the traffic become little higher than yesterday and it is loading very slowly. I have webmin control panel which loads very fast as usual. But site's performance is very slow. I just uploaded a text file and a html file. Both took 10 to 20 seconds to load.
Do you have munin ? Awesomely useful to know where your server is hitting a bottleneck. It comes with Virtualmin, I know, but I don't know if it comes with webmin by default. If you don't have enough CPU or RAM, you'll need a better machine or you'll have to optimize the website's software. If you're running slow on Apache threads ("apache processes", in Munin, if your graph shows the dark green lower area not fluctuating but making a horizontal line, it's your bottleneck), however, then in /etc/apache2/apache2.conf Around line 100, find ServerLimit and MaxClients and increase these a bit. Watch out, it can suck out your RAM or CPU verrrry fast, don't increase them too much.
I dont have munin. Can i install it now? I have lot of free ram and cpu. But the loading is very slow. As i already mentioned, the site is slow, but webmin is faster. I dont know what could be the problem I have already increased those values in httpd.conf But still there is no improvement. prefork MPM <IfModule prefork.c> StartServers 50 MinSpareServers 15 MaxSpareServers 30 ServerLimit 256 MaxClients 225 MaxRequestsPerChild 4000 </IfModule>
Ah, it's something else for me (recent intel quad core, 16 GB ram), so, sorry, I can't help. Just in case, my config : <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 ServerLimit 400 MaxClients 400 MaxRequestsPerChild 1000 </IfModule>
I found the problem. It is dos attack. in messages. I have installed csf and and enabled the following. CT_LIMIT = 25 and SYNFLOOD = 1 What else should i do now to avoid it?
Have you done any kernel hardening? Tweaked the synflood settings? Installed a reverse proxy like maybe nginx?
No. I have installed only CSF and module to to apache to control the too many connections. But the IP range are quite different so, the methods are not working
I hired a freelancer. He is not much good. But he is saying that it is not an attack. How do i optimize httpd.conf to handle huge traffic? My current settings.
Have you looked into maybe using nginx as a frontend/reverse proxy to handle and take some of the load off apache?
You can use nginx to serve static and cache it all and proxy the dynamic to apache. Google "nginx reverse proxy" it will get you started. The installation is pretty straight forward. PM if you have any issues or problems.
what is your server configuration ... i would advise you to increase the follwoing : ServerLimit 400 MaxClients 400 Nginx will perform better in high traffic sites Just let me know or pm me if you want any help Take care