Wednesday, 4 May 2016

KeepAlive On vs. KeepAlive Off


HTTP is stateless protocol which makes a connection to transfer a single file and closes it.
It is not very efficient.

keepalive provides a persistent connection which uses same TCP connection for HTTP conversation instead of opening a new connection for each new request.

KeepAlive disabled

  • opens a new connection for each new request
    • Impact : Takes longer time to open web pages and wastes server resources
  • HTTP header used : connection: close

----- HTML ------>
<--------------------
------- CSS ------->
<--------------------
------- JS --------->
<--------------------

KeepAlive enabled

  • uses same TCP connection for HTTP conversation
    • improves website speed ; Better user experience
    • reduces CPU usage (for creating and closing multiple connections)
    • uses more RAM as Apache waits for multiple requests
  • HTTP header used : Connection: Keep-Alive


HTML, CSS, JS
-------------------------->

No comments:

Post a Comment

Note: only a member of this blog may post a comment.