HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using a single TCP connection to send and receive multiple HTTP requests/responses, as opposed to opening a new connection for every single request/response pair. The newer HTTP/2 protocol uses the same idea and takes it further to allow multiple concurrent requests/responses to be multiplexed over a single connection.
Questions tagged [persistent-connection]
153 questions
576
votes
11 answers
Max parallel HTTP connections in a browser?
I am creating some suspended connections to an HTTP server (comet, reverse AJAX, etc). It works ok, but I see the browser only allows two suspended connections to a given domain simultaneously. So if a user is looking at my website in Tab1 of their…
Mark
15
votes
4 answers
Persistent SMTP connection in PHPMailer
How to enable persistent SMTP connections in PHPMailer?
I will send many emails, so with persistent connections probably I will get performance gain.

Paulo Coghi
- 13,724
- 14
- 68
- 90
14
votes
1 answer
How can I reuse a HttpClient connection efficiently?
I am doing HTTP POSTs very frequently (>= 1/sec) to an API endpoint and I want to make sure I'm doing it efficiently. My goal is to succeed or fail as soon as possible, especially since I have separate code to retry failed POSTs. There is a nice…

pr1001
- 21,727
- 17
- 79
- 125
13
votes
4 answers
BASH CURL: Don't close connection in between requests when run sequentially
I am trying to write a BASH command that uses CURL to send a GET request to two different web pages but uses the same connection. For me, it is like sending a GET request to a login page to authenticate to the server and then the second request…

ecbrodie
- 11,246
- 21
- 71
- 120
12
votes
1 answer
how to change timeout for mysql persistent connections
Where is defined timeout of persistent connections? Is it possible to change it?

user198003
- 11,029
- 28
- 94
- 152
10
votes
2 answers
closing db connection with django's persistent connection in a multi-threaded script
Django 1.6 introduces a Persistent Connections feature. However I've noticed that exiting a script that uses django's ORM leaves at least some of the connections open on the db side.
Setup: django 1.6.0, postgres 9.2 and psycopg2 2.5.1.
How do you…

Jonathan Livni
- 101,334
- 104
- 266
- 359
8
votes
2 answers
What is the use of http non persistent connection mode
It may seem to be a trivial question but still.. I have a confusion over it.
Almost at every site I have read that HTTP persistent or keep-alive connections are better than the non-persistent one.
Ques: So, why do non-persistent even exists?
Some…

user3275095
- 1,605
- 4
- 24
- 36
7
votes
1 answer
http request cancelled on javascript html5 audio preload
I'm trying to preload audio files with javascript. I'm using chrome,
When the number of files growing up the http request of my files are cancelled by chrome...
why? what can i do?
This is my code:
filesToLoad = 44;
filesLoaded = 0;
for ( var ni =…

user1249687
- 79
- 3
7
votes
2 answers
CodeIgniter Multiple Databases Persistent Connection?
I'm using multiple database in my CodeIgniter application and have been reading a lot that persistent connections should be turned off.
Why is this measure recommended and is this still necessary in the newest version, 2.0.2?
I'm doing things like…

user599146
- 344
- 5
- 17
7
votes
3 answers
How to solve timeout issues caused by bad HTTP persistent connection?
I've been struggling with an HTTP timeout issue recently. After more than one month of investigation I'm quite sure that it is caused by bad HTTP persistent connections. Details are as follows:
It is an iOS app.
Most users are running iOS 8.
I'm…

an0
- 17,191
- 12
- 86
- 136
6
votes
2 answers
TCP load balancing in HAProxy with persistent TCP connections
Currently, I have a single client (component) having a single persistent TCP connection with the server(another component), and messages are exchanged asynchronously. I wanted to have a load balancer (HAProxy preferably) where the connection b/w…

ks2bmallik
- 184
- 3
- 18
6
votes
2 answers
memcached persistence in PHP does not work as expected
i have played a bit around with different memcached library and plugin version to enable real persistence between PHP memcache client and memcached server.
The problem is that still connections are opened and closed so that the connection counter…

Artur Wawrzynkiewicz
- 61
- 1
- 2
5
votes
1 answer
Browser failing to renegotiate DNS on persistent connection
I’m investigating a scenario with a live dashboard (Angular web app) that is refreshed every 5 seconds (polling). The API is sitting behind Azure Traffic Manager which will fail over to a second region in the event of a failure in the primary…

Eric Marunde
- 151
- 3
5
votes
1 answer
How many maximum number of simultaneous Chrome connections/threads I can start through Selenium WebDriver?
Assuming I do not have a Grid setup, what is the Maximum number of simultaneous Chrome threads I can start from Selenium WebDriver?
Is it 5? And does it hold good for Chrome Headless as well?

whydoieven
- 589
- 2
- 7
- 21
5
votes
3 answers
Tornado Web Framework Mysql connection handling
I have recently been exploring the Tornado web framework to serve a lot of consistent connections by lots of different clients.
I have a request handler that basically takes an RSA encrypted string and decrypts it. The decrypted text is an XML…

Crowe T. Robot
- 2,045
- 17
- 18