|
|
|
|
|
|
|
[Original]
[Print]
[Top]
|
Hi,
I'm running apache 2.2 on a rhel server. Everything is up to date. It is being used for an advertising campaign server and handles about 6m hits a day.
Here's the problem: The http server is very slow to respond (if at all; it frequently times out) from the client side. The machine is a dual dual core opteron with 2gb of ram in a datacenter. Bandwidth is not the problem, nor is the hardware.
Netstat shows that the machine has on average 500-600 or more sockets open simultaneously.
top shows that none of the http child processes are eating up the processor, so it can't be a matter of hardware requirements.
I'm using the default mpm settings. What could be causing this?
Thanks!
|
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
Look, Optimization and security is a journey not the destination
You need to keep on looking, experiment and hunt for the best way to optimize the web server, there are 100's of way to do the optimization (google) but it may happen none of them will optimize your web server, every servers running Apache are different and they have a different way to optimize.
Few areas you should look at
1) Optimize your filesystem (Sync interval, noatime, partitions, bufferes, cache, etc ..) 2) Optimize your networking settings (TCP settings, timeout, connections, buffers, cache, Kernel packet processing, etc ...) 3) Optimize your caching techniques (put on your stating pages on your ram) 4) Optimize your apache modules, no of process, threads running 5) Add compression module to apache so that it can send the compressed pages
|
|
|
----
Check more at : http://linux-poison.blogspot.com
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
I'm not trying to "optimize" it so much as I am trying to get it to work properly on a basic level. I don't think that 6 million hits per day should bring apache down to its knees.
I used iptables to block all http traffic to the server except from my machines and stormed apache with requests from some of my other machines and was getting about 100 hits per second on the server. It didn't slow down at all. Also, it closed the sockets instantly as soon as the request was done and only kept a handful running at a time.
The main file that is being served by apache is a 1kb php script. I don't think it should be keeping so many sockets open at a time for such a small script. Is there any way to have the sockets time out in a shorter amount of time?
|
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
For socket time you need to look at the /proc filesystem and tune some of the the kernel Networking feature.
You should seriously read this : http://ipsysctl-tutorial.frozentux.net/
|
|
|
----
Check more at : http://linux-poison.blogspot.com
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
Hmm... it appears to be working now. I think messing with the MPM settings did it. Before, it only had about 32 child processes spawned, now it has 250+.
Thanks for the link to the socket stuff, I'm going to check that out!
|
|
|
[Original]
[Print]
[Top]
|
|
|