HTTP Non-Persistent & Persistent Connection

Introduction to HTTP Connections

Hypertext Transfer Protocol (HTTP) is the foundation of communication on the World Wide Web. It follows the client-server model where a client (such as a browser) requests data from a web server. The mode of connection used in HTTP significantly impacts the efficiency and performance of data transmission. There are two primary types of HTTP connections: Non-Persistent and Persistent.

HTTP Non-Persistent Connection

A non-persistent connection is the traditional mode of HTTP communication where a separate TCP connection is established for each HTTP request-response pair. Once the server sends the response, the connection is closed.

Characteristics of Non-Persistent Connection:

  1. Multiple TCP Connections: Each request-response cycle requires a new connection.
  2. Increased Latency: Establishing a new connection for every request leads to higher overhead.
  3. Short-Lived Connection: After serving the response, the connection is terminated.
  4. Less Efficient for Multiple Requests: Each object on a webpage (HTML, CSS, images, scripts) requires a separate connection.

Advantages of Non-Persistent Connection:

  • Simple to implement.
  • Reduces server resource usage by closing connections quickly.

Disadvantages of Non-Persistent Connection:

  • Higher latency due to multiple TCP handshakes.
  • Increased network congestion as each request requires a separate connection.

HTTP Persistent Connection

A persistent connection (also known as a keep-alive connection) allows multiple requests and responses to be sent over a single TCP connection, reducing the overhead of establishing new connections.

Characteristics of Persistent Connection:

  1. Single TCP Connection: The connection remains open for multiple request-response transactions.
  2. Reduced Latency: Avoids repeated connection setup, improving efficiency.
  3. Keep-Alive Mechanism: The connection remains active until a timeout or until explicitly closed.
  4. Better Performance for Multiple Requests: Ideal for loading complex web pages with multiple objects.

Advantages of Persistent Connection:

  • Reduces the overhead of establishing multiple connections.
  • Enhances web performance and speeds up content delivery.
  • Lowers network congestion due to fewer TCP connections.

Disadvantages of Persistent Connection:

  • Increased resource usage on the server due to maintaining open connections.
  • Requires additional management to handle timeouts and connection limits.

Comparison Between Non-Persistent and Persistent Connections

FeatureNon-Persistent ConnectionPersistent Connection
TCP ConnectionNew connection per requestSingle connection for multiple requests
LatencyHigher due to multiple handshakesLower due to a single handshake
Network OverheadHigh due to frequent connection setupLower due to reuse of connection
EfficiencyLess efficient for multiple requestsMore efficient for multiple requests
Server LoadLower (connections close quickly)Higher (connections stay open longer)

Conclusion

Non-persistent and persistent connections are two fundamental approaches in HTTP communication. Non-persistent connections, while simpler, result in increased latency due to frequent connection establishment. In contrast, persistent connections enhance efficiency by keeping a single connection open for multiple requests. Modern web applications prefer persistent connections to optimize performance and reduce network congestion.

Numerical Problems

1. Latency Calculation for Non-Persistent Connection

A webpage consists of 10 objects, and each object requires a separate HTTP request. If the Round Trip Time (RTT) is 100 ms and each request-response cycle requires 2 RTTs, what is the total time required to load the page using a non-persistent connection?

Solution: Total time = Number of objects × Time per request-response cycle = 10 × (2 × 100 ms) = 2000 ms or 2 seconds.

2. Efficiency of Persistent Connection

If the same webpage with 10 objects is loaded using a persistent connection and the initial connection setup takes 2 RTTs while each subsequent request takes 1 RTT, what is the total load time?

Solution: Total time = Initial setup time + (Number of objects × Time per object) = (2 × 100 ms) + (10 × 100 ms) = 200 ms + 1000 ms = 1200 ms or 1.2 seconds.

Example

Scenario: A client wants to download a webpage with index.html and three images: image1.jpg, image2.png, and image3.gif.

Assumptions:

  • RTT (Round Trip Time): The time it takes for a small packet to travel from the client to the server and back is 20 ms. We’ll assume this is constant for all connections.
  • Server Processing Time: The time the server spends processing a request (finding the file, etc.) is negligible (0 ms).
  • File Sizes & Transmission Times:
    • index.html: 5 KB (5 * 1024 bytes). Transmission time = 40 ms (calculated based on an assumed bandwidth – this is just an example, you’d use a realistic bandwidth for a real-world scenario. We are just using this to show a relative difference).
    • image1.jpg: 10 KB. Transmission time = 80 ms.
    • image2.png: 15 KB. Transmission time = 120 ms.
    • image3.gif: 20 KB. Transmission time = 160 ms.

1. Non-Persistent HTTP:

In a non-persistent connection, a new TCP connection is established for each request (HTML file and each image).

  • index.html:
    • Establish TCP connection: 1 RTT (20 ms)
    • Send request: Negligible (we are ignoring server processing time).
    • Receive index.html: 40 ms
    • Close TCP connection: 1 RTT (20 ms)
    • Total for index.html: 20 + 40 + 20 = 80 ms
  • image1.jpg:
    • Establish TCP connection: 1 RTT (20 ms)
    • Receive image1.jpg: 80 ms
    • Close TCP connection: 1 RTT (20 ms)
    • Total for image1.jpg: 20 + 80 + 20 = 120 ms
  • image2.png:
    • Establish TCP connection: 1 RTT (20 ms)
    • Receive image2.png: 120 ms
    • Close TCP connection: 1 RTT (20 ms)
    • Total for image2.png: 20 + 120 + 20 = 160 ms
  • image3.gif:
    • Establish TCP connection: 1 RTT (20 ms)
    • Receive image3.gif: 160 ms
    • Close TCP connection: 1 RTT (20 ms)
    • Total for image3.gif: 20 + 160 + 20 = 200 ms
  • Grand Total (Non-Persistent): 80 + 120 + 160 + 200 = 560 ms

2. Persistent HTTP (without pipelining):

With persistent connections, the TCP connection remains open after the server sends the response for the first request. However, the client waits for the response to the previous request before sending the next.

  • index.html:
    • Establish TCP connection: 1 RTT (20 ms)
    • Receive index.html: 40 ms
    • Total for index.html: 20 + 40 = 60 ms
  • image1.jpg:
    • Send request (over existing connection): Negligible
    • Receive image1.jpg: 80 ms
    • Total for image1.jpg: 80 ms
  • image2.png:
    • Send request: Negligible
    • Receive image2.png: 120 ms
    • Total for image2.png: 120 ms
  • image3.gif:
    • Send request: Negligible
    • Receive image3.gif: 160 ms
    • Close TCP connection: 1 RTT (20ms) (Connection can be closed after all transfers)
    • Total for image3.gif: 160 + 20 = 180 ms
  • Grand Total (Persistent without pipelining): 60 + 80 + 120 + 180 = 440 ms

3. Persistent HTTP (with pipelining):

With pipelining, the client can send multiple requests over the same persistent connection without waiting for the response to each individual request.

  • index.html:
    • Establish TCP connection: 1 RTT (20 ms)
    • Receive index.html: 40 ms
    • Total for index.html: 20 + 40 = 60 ms
  • image1.jpg:
    • Receive image1.jpg: 80 ms
    • Total for image1.jpg: 80 ms
  • image2.png:
    • Receive image2.png: 120 ms
    • Total for image2.png: 120 ms
  • image3.gif:
    • Receive image3.gif: 160 ms
    • Close TCP connection: 1 RTT (20ms)
    • Total for image3.gif: 160 + 20 = 180 ms
  • Grand Total (Persistent with pipelining): 60 + 80 + 120 + 180 = 440 ms (In this specific example, pipelining doesn’t offer much improvement because the transmission times are much larger than the RTT. Pipelining’s advantage is more apparent when RTTs are significant compared to transmission times)

Key Observations:

  • Non-persistent HTTP has a significant overhead due to establishing and closing a TCP connection for every single file.
  • Persistent HTTP reduces this overhead considerably.
  • Pipelining can further improve performance, especially when RTTs are a larger proportion of the total time.

39 thoughts on “HTTP Non-Persistent & Persistent Connection

  1. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Anky
    Lets Get You Optimize
    Accounts Manager
    http://www.letsgetuoptimize.com
    Phone No: +1 (949) 508-0277

  2. Hey team examhope.com,

    Hope your doing well!

    I just following your website and realized that despite having a good design; but it was not ranking high on any of the Search Engines (Google, Yahoo & Bing) for most of the keywords related to your business.

    We can place your website on Google’s 1st page.

    * Top ranking on Google search!
    * Improve website clicks and views!
    * Increase Your Leads, clients & Revenue!

    Interested? Please provide your name, contact information, and email.

    Well wishes,
    Paul S
    +1 (949) 313-8897
    Paul S| Lets Get You Optimize
    Sr SEO consultant
    http://www.letsgetuoptimize.com
    Phone No: +1 (949) 313-8897

  3. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Anky
    Lets Get You Optimize
    Accounts Manager
    http://www.letsgetuoptimize.com
    Phone No: +1 (949) 508-0277

  4. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Anky
    Lets Get You Optimize
    Accounts Manager
    http://www.letsgetuoptimize.com
    Phone No: +1 (949) 508-0277

  5. Hey team examhope.com,

    Hope your doing well!

    I just following your website and realized that despite having a good design; but it was not ranking high on any of the Search Engines (Google, Yahoo & Bing) for most of the keywords related to your business.

    We can place your website on Google’s 1st page.

    * Top ranking on Google search!
    * Improve website clicks and views!
    * Increase Your Leads, clients & Revenue!

    Interested? Please provide your name, contact information, and email.

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  6. 947853 642481When I originally commented I clicked the -Notify me when new surveys are added- checkbox and from now on whenever a comment is added I purchase four emails sticking with exactly the same comment. Possibly there is by any indicates you could get rid of me from that service? Thanks! 27137

  7. Pingback: My Homepage
  8. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  9. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  10. Build Funnels In 60 Seconds. Auto-Write Emails. Sell Courses. Run Webinars.

    Tag Leads. Book Clients. Automate EVERYTHING. All Without Leaving One Tab.

    No Frankenstein Hacks. No Plugin Failures. No API Glitches.

    TRY IT NOW! hamsterkombat.expert/OriginSuite

  11. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  12. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  13. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.letsgetoptimize.com
    Phone No: +1 (949) 508-0277

  14. ” Boost your [‘www.examhope.com] with ‘Money Robot AI’ – an advanced automated link building software, now available with a 7-day free trial! ”

    Sign up today for free trial :- http://moneyrobot.marketinghelp.online/

    ✅ No credit card required
    ✅ Easy to use
    ✅ Fully automated SEO solution

    Note: Kindly ignore if found irrelevant

  15. Hi, examhope.com’admin,

    Sorry, this is the poll I sent you previously. Unfortunately, I lost your email address. Could you please submit your opinion again? That would be very helpfiul.

    Take a look:https://afshinkalhori.ir/global-conflicts

    Curious what you think!

    Best,

    [Afi]

    Its great honor for our team to work with such admin like you.
    Also, if you ever need help with website design, SEO, or optimization, feel free to reach out: afsoriproject@gmail.com
    or Telegram: +1 814 975 4523 | whatapp: +1 (615) 561-8321
    ————————————-
    Also there is helpful link for making money easily with only share your internet:
    https://afshinkalhori.ir/pawns.app

  16. One Platform, Every Top AI Model—No Monthly Fees, No Hassle!

    Access ChatGPT, Claude, Gemini Pro , Kling AI, LLaMA, Mistral, DALL.E, LLaMa & more—all from a single dashboard.

    No subscriptions or no monthly fees—pay once and enjoy lifetime access.

    Automatically switch between AI models based on task requirements.

    And much more … https://hamsterkombat.expert/AIIntelliKit

  17. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  18. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.letsgetoptimize.com
    Phone No: +1 (949) 508-0277

  19. Hey team examhope.com,

    Hope your doing well!

    I just following your website and realized that despite having a good design; but it was not ranking high on any of the Search Engines (Google, Yahoo & Bing) for most of the keywords related to your business.

    We can place your website on Google’s 1st page.

    * Top ranking on Google search!
    * Improve website clicks and views!
    * Increase Your Leads, clients & Revenue!

    Interested? Please provide your name, contact information, and email.

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  20. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  21. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.letsgetoptimize.com
    Phone No: +1 (949) 508-0277

  22. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.letsgetoptimize.com
    Phone No: +1 (949) 508-0277

  23. ” Boost your [‘www.examhope.com] with ‘Money Robot AI’ – an advanced automated link building software, now available with a 7-day free trial! ”

    Sign up today for free trial :- http://moneyrobot.marketinghelp.online/

    ✅ No credit card required
    ✅ Easy to use
    ✅ Fully automated SEO solution

    To know more : https://marketing-help-money-robot.blogspot.com/2025/05/ai-seo-tool-secret-weapon-in-2025.html

    Note: Kindly ignore if found irrelevant

  24. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  25. I’ve learned several important things as a result of your post. I’d personally also like to mention that there may be a situation in which you will apply for a loan and never need a co-signer such as a National Student Aid Loan. However, if you are getting a borrowing arrangement through a regular creditor then you need to be ready to have a co-signer ready to assist you. The lenders are going to base their decision on the few components but the most significant will be your credit ratings. There are some loan providers that will in addition look at your work history and determine based on this but in many instances it will hinge on your report.

  26. Thanks for discussing your ideas here. The other point is that when a problem takes place with a laptop motherboard, persons should not consider the risk regarding repairing it themselves because if it is not done properly it can lead to irreparable damage to the entire laptop. It will always be safe to approach a dealer of a laptop for any repair of its motherboard. They’ve technicians who may have an experience in dealing with notebook motherboard issues and can make the right prognosis and accomplish repairs.

  27. Good web site! I truly love how it is easy on my eyes and the data are well written. I’m wondering how I might be notified whenever a new post has been made. I’ve subscribed to your RSS feed which must do the trick! Have a great day!

  28. There are certainly lots of details like that to take into consideration. That may be a nice level to bring up. I provide the thoughts above as general inspiration but clearly there are questions just like the one you carry up the place a very powerful factor shall be working in honest good faith. I don?t know if greatest practices have emerged around issues like that, but I am certain that your job is clearly identified as a fair game. Each boys and girls feel the affect of just a second抯 pleasure, for the remainder of their lives.

  29. Dear team,

    I hope you’re doing well.

    I came across your site ” examhope.com “! discovered your website through our domain monitoring tool. With this milestone reached, it’s the perfect stage to enhance your visibility online.

    Not sure how to boost your website’s performance? Let us show you the way forward.

    ✅ SEO – Comprehensive SEO strategies tailored for measurable success

    ✅ Social Media Marketing– Facebook, LinkedIn, Instagram, YouTube etc.

    ✅ Web Design – Sleek, responsive websites and complete redesign solutions

    ✅ Google Ads – Sharply-targeted PPC campaigns engineered to boost returns

    Interested? Just reply with your name, phone, and email.

    Cheers,
    Bemi Brooks | Sr. SEO & Local Listings Expert
    MapMyBiz.org

    “I believe your work deserves to be found.”

    Note: – If you’re not Interested in our Services, send us ” NO “

  30. Hey team examhope.com,

    I would like to discuss SEO!

    I can help your website to get on first page of Google and increase the number of leads and sales you are getting from your website.

    May I send you a quote & price list?

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  31. Hey team examhope.com,

    Hope your doing well!

    I just following your website and realized that despite having a good design; but it was not ranking high on any of the Search Engines (Google, Yahoo & Bing) for most of the keywords related to your business.

    We can place your website on Google’s 1st page.

    * Top ranking on Google search!
    * Improve website clicks and views!
    * Increase Your Leads, clients & Revenue!

    Interested? Please provide your name, contact information, and email.

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

  32. Hey team examhope.com,

    Hope your doing well!

    I just following your website and realized that despite having a good design; but it was not ranking high on any of the Search Engines (Google, Yahoo & Bing) for most of the keywords related to your business.

    We can place your website on Google’s 1st page.

    * Top ranking on Google search!
    * Improve website clicks and views!
    * Increase Your Leads, clients & Revenue!

    Interested? Please provide your name, contact information, and email.

    Bests Regards,
    Ankit
    Best AI SEO Company
    Accounts Manager
    http://www.bestaiseocompany.com
    Phone No: +1 (949) 508-0277

Leave a Reply

Your email address will not be published. Required fields are marked *