Questions tagged [keep-alive]

A feature of HTTP where the same connection is used for multiple requests, speeding up downloading of web pages with multiple resources.

892 questions
13
votes
1 answer

How to use tcp_keepalives settings in Postgresql?

Postgresql has 3 keepalive settings for managing dropped connections (in postgresql.conf): tcp_keepalives_count tcp_keepalives_idle tcp_keepalives_interval By default these are 0. The behavior I would like is for Postgresql to drop client…
Paul Lefebvre
  • 6,253
  • 3
  • 28
  • 36
12
votes
1 answer

Keep XMPP connection (using asmack) alive on Android

I'm developing an application that receives push notifications via XMPP ( I know C2DM, but it has some limitations and I can't use because of it ), the problem is the connection that after some time is garbage collected and I can't send push…
danilodeveloper
  • 3,840
  • 2
  • 36
  • 56
12
votes
11 answers

C# Console Application - Keep it running

I am about to develop a console application that will be required to continually run and carry out work at specific times. My question is what is are best methods or practices to keep your application alive? My thought were: A loop that never…
None
12
votes
1 answer

Pros and Cons of Keep-Alive from Web Server Side

Keep-Alive connection feature in HTTP protocol is meant to reduce TCP connection hits to web server. It should be able to improve web server performance. However, I found that some web servers deliberately disable KeepAlive feature from server side.…
Morgan Cheng
  • 73,950
  • 66
  • 171
  • 230
12
votes
1 answer

AFNetworking/NSURLConnection HTTPS keep alive shows strange behaviour

We're currently dealing with a performance issues in our app, and we believe that some of these issues might be related to the fact that the app and the underlying AFNetworking network stack seems to ignore keep-alive on HTTP 1.1. We got information…
WarrenFaith
  • 57,492
  • 25
  • 134
  • 150
11
votes
4 answers

TCP keep-alive gets involved after TCP zero-window and closes the connection erroneously

We're seeing this pattern happen a lot between two RHEL 6 boxes that are transferring data via a TCP connection. The client issues a TCP Window Full, 0.2s later the client sends TCP Keep-Alives, to which the server responds with what look like…
Martin Cowie
  • 2,788
  • 7
  • 38
  • 74
11
votes
3 answers

HTTP library for Ruby with HTTPS, SSL Client Certificate and Keep-Alive support?

I'm trying to write an HTTPS client in Ruby. It will connect to the server using HTTPS, passing an authentication token (obtained through a separate login process) and an SSL client certificate. I'm doing the following with rest-client: client =…
Duncan Bayne
  • 3,870
  • 4
  • 39
  • 64
11
votes
4 answers

Keeping a socket connection alive in iOS

I have the following code written in Objective-C that writes data to a socket. The server is running node.js on top of Ubuntu: NSString *url = @"anIPAddress"; CFReadStreamRef readStream; CFWriteStreamRef writeStream; …
Hahnemann
  • 4,378
  • 6
  • 40
  • 64
10
votes
1 answer

Why does ThreadPoolExecutor reduce threads below corePoolSize after the keepAliveTime?

I've been messing around with different strategies for thread pooling using ThreadPoolExecutor with JDK6. I have a Priority queue working but wasn't sure if I liked how the pool didn't size after keepAliveTime (what you get with an unbounded…
andematt
  • 403
  • 4
  • 10
10
votes
4 answers

How to set the keepalive timeout in Android?

I'd like to lower the TCP keepalive time on a Socket I'm opening from 2 hours to something on the order of ten minutes. I can make it use keepalive with socket.setKeepAlive(true), but how can I control the time before a keepalive packet is sent? It…
lacker
  • 5,470
  • 6
  • 36
  • 38
10
votes
1 answer

How to disable Keep-Alive in IIS conditionally?

My situation is the following: I have an ASP.NET Core REST API using Kestrel reverse proxied over IIS (through AspNetCoreModule). On a special endpoint (required by a hardware device) I send a 'Connection: close'-HTTP header. On all other endpoints…
10
votes
1 answer

Remove "Connection: keep-alive" response header in NGINX 204 response with HTTP/1.1

In any response served by NGINX, how can one remove the "Connection: keep-alive" header? We serve 100B+/month of sub 100-byte responses to under 10 clients from NGINX for RTB based ad serving. We're attempting to minimize the overhead (data size) to…
Michael Orlando
  • 111
  • 2
  • 5
10
votes
1 answer

Sending connection header set as keep-alive

I'm trying to send the same information from my application as I send from the browser. Here is part of data captured by Fiddler: POST http://something/ HTTP/1.1 Host: something.com Connection: keep-alive I got stuck with this connection property.…
Milan Novotný
  • 319
  • 2
  • 3
  • 8
10
votes
2 answers

How to send consecutive requests with HTTP keep-alive in node.js?

I'm using node.js 0.6.18, and the following code makes node.js close the TCP connection between every two requests (verified with strace on Linux). How do I make node.js reuse the same TCP connection for multiple HTTP requests (i.e. keep-alive)?…
pts
  • 80,836
  • 20
  • 110
  • 183
10
votes
1 answer

UIWebView and keep-alive?

I am setting up an UIWebView to show the contents of a web camera through a URL that retrieves an MPJEG-stream. I found out that if I wanted to switch to a different camera, it looked smoother if I did not reset the entire contents of the UIWebView,…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825