Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-19-2002, 12:10 AM   #1
Registered: Jun 2001
Distribution: FC4
Posts: 136

Rep: Reputation: 15
Apache KeepAlive question

Running RH7.1

Apache1.3 with virtual hosting.

I'm gettgin a lot of hits which is saturating my T-1. The server however, is hardly working due to it's efficiency.

I have turned KeepAlive off to free up bandwidth.

Is this correct?

Old 06-19-2002, 05:38 AM   #2
Senior Member
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
I think it would do the opposite. The keepalive allows it to keep the same connection open to retrieve more files.

With keepalive off. The browser will connect retrieve a file and get disconnected. Next file the same thing will happen.

With keepalive on. The browser will connect and retrieve a file. After the file is done it's able to request another file without reopening the connection.
Old 06-19-2002, 10:10 AM   #3
Registered: Jun 2001
Distribution: FC4
Posts: 136

Original Poster
Rep: Reputation: 15
However, if I have thousands of people activating keepalive connections then the bandwidth that is used as a keepalive is unable to serve a new request.

I think it is more server intensive to have keepalive off because the server is having to open and close connections but at the same time the line is not holding these keepalives.


Last edited by 360; 06-19-2002 at 10:42 AM.
Old 06-22-2002, 12:43 PM   #4
Registered: Dec 2001
Distribution: RH5.2/6.2/7.0/7.1/7.2/9/ES21/ES31
Posts: 91

Rep: Reputation: 15
The keepalive setting forces Apache to terminate the tcp connection if no browser activity has occured for 15 seconds. Otherwise it doesn't do anything.

I'd guess there would be more bandwidth used if turning this setting off because if the connection is terminated by Apache, the browser won't know it (because, afterall, the browser was inactive for 15 seconds). When the browser tries to access the server, the server will reject the request and cause the browser to reestablish the connection. Those few tcp packets sent back and forth would eat more bandwidth.

If you're worried about bandwidth, then you'll probably want to leave this setting on. If you're worried about number of people who can at least partially access your server, then turn this off.

Bandwidth saturation can be a tricky issue to resolve when it's web related. It might depend on your clients -- are they using modems, or T1s themselves? Are they retrieving mostly static web pages, or huge bitmaps? Are all those hits legit (could be someone attacking your server, in which case you definately don't want the keepalive off). Maybe it's time to upgrade your net connection? Thousands of hits over a day is no problem for a T1.Thousands of hits over, say, a second, might not run to hot.

You might consider tuning Apache so that it only allows a certain number of connections. I think the default setting is 256 (hardcoded, can be changed but requires a recompilation). If that number is exceeded, you'll receive a too many users error (503 I think). If you're concerned with user experience, you might consider tuning Apache down a bit so that it allows fewer sessions, and then leave keepalive off. This will help deter bandwidth saturation, and leaving keepalive off will help deter dos hacks on your server.

Just my .02
Old 06-22-2002, 01:09 PM   #5
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 12,434

Rep: Reputation: 3312Reputation: 3312Reputation: 3312Reputation: 3312Reputation: 3312Reputation: 3312Reputation: 3312Reputation: 3312Reputation: 3312Reputation: 3312Reputation: 3312
I would recommend the you turn KeepAlive on and adjust KeepAliveTimeout (and possibly MaxKeepAliveRequests) appropriatly. Without KeepAlive you need to setup a new TCP session for every request and you lose the Min/Max/Start server settings.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
KEEPALIVE does not detect disconnection at the expected time emonette Linux - Networking 0 02-16-2005 04:02 AM
Apache Question LiNuXn00biE_2.4 Linux - Newbie 4 11-02-2004 04:27 PM
Problem with 'KeepAlive' in AMSN timberwolf Linux - Networking 0 12-05-2003 03:08 AM
DSL keepalive nowonmai Linux - Networking 1 08-25-2003 09:16 AM
Apache Question msmith7735 Linux - General 1 02-19-2002 07:22 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:48 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration