Activity Stream
48,167 MEMBERS
6977 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Member
    Website's:
    StudentSharez.com

    Default KeepAlive, On or Off?

    Hello,
    Which is better:
    KeepAlive On
    or
    KeepAlive Off

    ?

    and what is the difference between them?

    Thanks
    DoctorX Reviewed by DoctorX on . KeepAlive, On or Off? Hello, Which is better: KeepAlive On or KeepAlive Off ? and what is the difference between them? Rating: 5
    Offshore-host.blogspot.com - List of DMCA flexible webhosts.
    StudentSharez.com - Medical ebooks and lectures.

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    host4offshore.com
    KeepAlive On
    || Host4Offshore :: Reliable, Quality, Fast Offshore Hosting Solution (USA/Netherlands/Sweden/Russia/Romania)
    || Shared , Reseller Hosting Sales Thread
    || Rapidleech Hosting Sales Thread
    || Current Promotion

  4.     
    #3
    Moderator
    NewEraCracker's Avatar
    Read here: https://secure.wikimedia.org/wikiped...ent_connection

    Personally, I have it Off in my server.
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  5.     
    #4
    Member
    Website's:
    donkiehost.com
    Off is better to avoid high server load.
    DonkieHost.com - Web Hosting Solutions
    Shared Web Hosting | Resellers | Domains | SSL Certificates | VPS | Rapidleech | Remote Desktop

  6.     
    #5
    It begins...
    There is no definitive recommendation. If someone tells you 'it is better to keep it off', they are wrong. If they tell you 'it is better to keep it on', they are wrong again.

    KeepAlive, basically, allows your server to serve multiple requests on a single connection. Whether you are going to need to keep it OFF or ON, depends entirely on what your server is used for and what you need to deliver.

    Say, for example, you have a webpage that has 25 images all on the same page along with content and stuff. You have (for simplicity's sake), 1,000 visitors hitting that web page at any given time. When a visitor hits that page, he'll download the page content and the 25 images. 1,000 visitors hitting the page at the same time will download an equivalent to 1,000 pages and 25,000 images.

    How does Keep-Alive come into play?

    If you have Keep-Alive turned on, each visitor will establish one connection to your server, and all requests will be served through that one connection. Thus, to download 26 elements from your server, only one connection will be used. Scale that to 1,000, and you will have only 1,000 connections open.

    So, if you have Keep Alive turned off, each visitor will end up establishing as many connections as the number of elements it needs to download. That is to say, each connection will serve one request. So each visitor establishes 26 connections. Scale that, and you'll have 26,000 connections.

    Now I obviously don't need to tell you which one, out of the above two scenarios, is optimal. But my illustration is not conclusive. You cannot apply that logic to every situation.

    Say, you have a single web page. No images. You have 1,000 people hitting your webpage. Whether you have Keep Alive turned on or off, you'll be serving 1,000 connections, no more. HOWEVER, if you have Keep Alive turned ON and the Keep Alive timeout is set at the default (60 seconds, that's extremely high); every connection established to your server will be held on for 60 seconds before it times out and closes itself. This will eventually waste your server resources keeping connections open that you don't need.

    So is KeepAlive better left off, or should it be turned on? The answer to that, depends entirely on the kind of website you run.

    Personally, I have it switched off; I run an image host, so not every client that downloads an element from my site necessarily downloads tens others. I will, at any given time, have a majority of people downloading just one or two images from my site/server. I would have KeepAlive turned off to prevent keeping any needless connections open. OR, I could keep it on in the event that someone wants to download more than a few images, but with a very low timeout (say, 2 or 3 seconds) to rule out resource wastage due to unneeded open connections.

    Then again, when you're serving thousands of requests every second, 2 or 3 seconds matter a lot! So yeah, I have it turned off

    What you will do, depends on your site

  7.     
    #6
    Member
    Website's:
    StudentSharez.com
    Hello,
    Thank you Lifetalk. Very detailed and great explanation.
    Actually, I have searched about this on Google many times and didn't understand the actual function of KeepAlive.
    Currently, it is On on my server, and after reading your reply I have realized that it is better to keep it On for better performance.
    Regarding timeout, I think that mine is 5, I'll try to decrease it to 2 or 3 as you said.


    Thank you again.
    Offshore-host.blogspot.com - List of DMCA flexible webhosts.
    StudentSharez.com - Medical ebooks and lectures.

  8.     
    #7
    It begins...
    As I mentioned, 2 or 3 would be an optimal timeout value for a very busy site. If your site is not very busy, a timeout value of 5 seconds is just fine!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

BE SOCIAL