![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
Join Date: Aug 2001
Location: The Netherlands
Posts: 13,723
|
DO you use keep alive mod at apache?
are you using it? Some ppl say it's making requests going faster. Any experience here?
http://httpd.apache.org/docs-2.0/mod...html#keepalive
__________________
Questions? ICQ: 125184542 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Feb 2002
Location: Santa Monica, CA
Posts: 31
|
The only thing keepalive does is not run the 4-way close handshake on the TCP connection directly after fulfilling a request. It instead waits for a passive close, OR in the case of a timeout it does an active close.
There are benifits to this. For one, since the client would then be sending the 4-way handshake (FIN/ACK/FIN/ACK), the server would be doing a passive close on the TCP connection so the kernel would not put that child processess into TIME_WAIT. Additionally since most browsers use non-blocking sockets and async recvs, you can ususally get a few requests for each child fork(). However DO NOT set the Keepalive timeout too high! You do NOT need the default value of 15 seconds. Since Apache uses a pre-forking model to handle calls to accept, it is faster to just hand the request to a new child process if more than 2-3 seconds elapse in between requests. Just make sure that your MinServers and SpareServers are set to resonable values so that you don't run into a ramp-up effect of processess trying to fork(). The less time that Apache spends in the select() accept() loop the better because Apache uses a Mutex to protect the serialization of sockets which ends up blocking, so since most clients support HTTP/1.1 and Keepalive, it is usually a slight speed increase beacuse it does not get stuck polling the mutex. If for some reason the client only supports HTTP/1.0 (its usually a bot at this point), the Keepalive will timeout and apache will make an active close on the connection. so you only lost the initial timeout value over not using keepalive at all. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Too lazy to set a custom title
Join Date: Aug 2001
Location: The Netherlands
Posts: 13,723
|
Thnx a lot,
Andre
__________________
Questions? ICQ: 125184542 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Oct 2001
Location: Somewhere in time
Posts: 143
|
Basically what I'd say is if you use the server for TGP galleries, then go for it (KeepAlive On), if you serve mainly seperate files, turn it off.
Let's take an example with a gallery of 20 thumbs. With KeepAlive Off, the browser will open 1 connection for the HTML, will parse it then will open 1 connection to get each thumbs (which totals 21 connections). On the other hand, with KeepAlive On, the browser will open 1 connection for the HTML, parse it and reuse the connection to get the thumbs. Thus in a perfect world it would use only 1 connection instead of 21. In reality it doesn't work exactly like that, because usually browsers will open 2 connections at the same time to speed up things. But it still saves you a lot of connections and thus processing time and server ressources. But if you serve for instance .exe files or something like that, chances are thin a browser could reuse the connection and thus is pointeless. Just be sure to follow thepiper's advices and you'll be alright! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Oct 2001
Location: Upstate New Yawk
Posts: 276
|
Here's an interesting link. The relevant part is the persistent connection/pipelining section.
http://www.w3.org/Protocols/HTTP/Per.../Pipeline.html |
![]() |
![]() ![]() ![]() ![]() ![]() |