Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly does a "persistent connection" mean?

Tags:

I read about "HTTP persistent connection" but somehow I don't seem to understand what does persistent mean in this context.
Could you'll elaborate?

like image 762
Kevin Boyd Avatar asked Sep 26 '09 03:09

Kevin Boyd


People also ask

What is the meaning of persistent connection?

A persistent connection (HTTP persistent connection) is a network communication channel that remains open for further HTTP requests and responses rather than closing after a single exchange.

What is a persistent connection TCP?

TCP connections that are kept open after transactions complete are called persistent connections. Nonpersistent connections are closed after each transaction. Persistent connections stay open across transactions, until either the client or the server decides to close them.

What is the difference between persistent and non-persistent connections?

After the client receives the object in non-persistent, the connection is immediately closed. This is the basic difference between persistent and non-persistent. The persistent connection ensures the transfer of ​multiple objects over a single connection.

Which are benefits of persistent HTTP connections?

Advantages of persistent connections : 1) Lower CPU and memory usage because there are less number of connections. 2) Allows HTTP pipelining of requests and responses. 3) Reduced network congestion (fewer TCP connections). 4) Reduced latency in subsequent requests (no handshaking).


1 Answers

It means the server doesn't close the socket once it's finished pushing out the response (so the length of the response has to be otherwise indicated, via headers or chunking), so the client can make other requests on the same socket. A web page often requests several other pieces (images, CSS, scripts, ...) on the same server as the page itself, so reusing the socket for some of those further requests to the same server can reduce overall latency compared to closing the original socket and opening new ones for all the follow-on requests.

like image 99
Alex Martelli Avatar answered Sep 21 '22 15:09

Alex Martelli