AJAX persistance connection or close

Discussion in 'JavaScript' started by Ankit, May 12, 2006.

  1. #1
    I am using AJAX & PHP at server for retriving data from the server after every 10 second cycle.

    Shoud I use setRequestHeader("Connection", "close"); after every call or remain connection open(Persistance connection) for the puspose of http requests & server load.

    Please suggest.


    Ankitrd
     
    Ankit, May 12, 2006 IP
  2. Xig

    Xig Peon

    Messages:
    75
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    A request every 10 seconds shouldn't load a web server too heavily, depending on how many users you expect to have at any one time. Note that a persistent connection requires HTTP/1.1 compatability on your web server.

    Consider the user first, then see if you have the server-side capabilities to provide that level of service. Try a benchmark between the two of them, and see how well your application responds.

    Thats my tuppence :)
     
    Xig, May 12, 2006 IP
    Ankit likes this.
  3. Ankit

    Ankit Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    For more than 200 users at a time.

    System Configuration is Dual P4 Processors with 1 GB RAM.
     
    Ankit, May 16, 2006 IP
  4. Xig

    Xig Peon

    Messages:
    75
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Its hard to tell really, I'm not sure what your script is trying to achieve and how much load is expected on each request.

    Personally I stay away from the theoretical maths, get my hands dirty and do an experiment to see which would be most efficient.
     
    Xig, May 16, 2006 IP