HTTP keep-alive timeout

The client cannot specify the timeout, it is the server configuration that determines the maximum timeout value. The extra Keep-Alive header can inform the client how long the server is willing to keep the connection open (timeout=N value) and how many requests you can do over the same connection (max=M) before the server will force … Read more

python requests module and connection reuse

Global functions like requests.get or requests.post create the requests.Session instance on each call. Connections made with these functions cannot be reused, because you cannot access automatically created session and use it’s connection pool for subsequent requests. It’s fine to use these functions if you have to do just a few requests. Otherwise you’ll want to … Read more

Persistent/keepalive HTTP with the PHP Curl library?

cURL PHP documentation (curl_setopt) says: CURLOPT_FORBID_REUSE – TRUE to force the connection to explicitly close when it has finished processing, and not be pooled for reuse. So: Yes, actually it should re-use connections by default, as long as you re-use the cURL handle. by default, cURL handles persistent connections by itself; should you need some … Read more

How do I shutdown a Node.js http(s) server immediately?

The trick is that you need to subscribe to the server’s connection event which gives you the socket of the new connection. You need to remember this socket and later on, directly after having called server.close(), destroy that socket using socket.destroy(). Additionally, you need to listen to the socket’s close event to remove it from … Read more

http keep-alive in the modern age

Hey since I’m the author of this citation, I’ll respond 🙂 There are two big issues on large sites : concurrent connections and latency. Concurrent connection are caused by slow clients which take ages to download contents, and by idle connection states. Those idle connection states are caused by connection reuse to fetch multiple objects, … Read more

WebSockets ping/pong, why not TCP keepalive?

The problems with TCP keepalive are: It is off by default. It operates at two-hour intervals by default, instead of on-demand as the Ping/Pong protocol provides. It operates between proxies rather than end to end. As pointed out by @DavidSchwartz, it operates between TCP stacks, not between the applications so therefore it doesn’t tell us … Read more

Keep-alive header clarification

Where is this info kept (“this connection is between computer A and server F“)? A TCP connection is recognized by source IP and port and destination IP and port. Your OS, all intermediate session-aware devices and the server’s OS will recognize the connection by this. HTTP works with request-response: client connects to server, performs a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)