keep-alive

Why do dotnet keepalive Http connections fail on the second request with “A connection that was expected to be kept alive was closed by the server.”?

♀尐吖头ヾ 提交于 2021-02-11 14:41:29
问题 I have a dotnet framework application which performs POST api requests to a remote server running Apache. It intermittently fails with the error: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. This occurs on the second request to the server when done over a keepalive TLS connection, and so occurs more frequently in production systems under heavy load and less frequently or not at all in development environments. We have tried:

PHP: Keep HTTPS Connection to API open throughout multiple requests

徘徊边缘 提交于 2021-02-07 21:49:20
问题 I'm writing a plugin for wordpress that needs to call an API for every request the user makes. These API-calls are done using the HTTPS protocol. Currently, for every new user request, I need to reopen the HTTPS connection. Yes, curl allows persistent connections (reusing the handle or using the multi handle) but I would like to persist the connection throughout multiple user requests. So: Is it possible to keep a HTTPS connection open throught multiple PHP processes and reuse it? The

PHP: Keep HTTPS Connection to API open throughout multiple requests

与世无争的帅哥 提交于 2021-02-07 21:49:04
问题 I'm writing a plugin for wordpress that needs to call an API for every request the user makes. These API-calls are done using the HTTPS protocol. Currently, for every new user request, I need to reopen the HTTPS connection. Yes, curl allows persistent connections (reusing the handle or using the multi handle) but I would like to persist the connection throughout multiple user requests. So: Is it possible to keep a HTTPS connection open throught multiple PHP processes and reuse it? The

RestSharp: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server

回眸只為那壹抹淺笑 提交于 2021-02-07 07:40:25
问题 I am using RestSharp as the underlying HTTP client library to make a stress/throughput test client on a black box service. Threadpool and Servicepoint connection limits have been lifted to 5000, but that shouldn't be much of a worry as we are testing around 500-1000 requests per second. A high-resolution (microsecond) timer component is used to throw out requests at the rate we want to test. The RestSharp code roughly goes restClient.ExecuteAsync(postRequest, res => { stopwatch.Stop(); lock

How to enable Connection:Keep-Alive for aps.net core 2.1

人走茶凉 提交于 2021-01-29 07:14:34
问题 I have an asp.net core 2.1 website running on a windows server as an azure web app. I was asked to enable "keep-alive" so that when a client asks for "Connection:Keep-Alive" the connection is NOT closed. I cant find any documentation on how to do this (nor if this is even possible). The reason for getting a persistent connection (if this is the correct term) is to reduce the overhead from the SSL negotiation. I did find this: Azure Website Connection Keep-Alive stack-overflow question. The

How do connections recycle in a multiprocess pool serving requests from a single requests.Session object in python?

Deadly 提交于 2021-01-01 04:17:25
问题 Below is the complete code simplified for the question. ids_to_check returns a list of ids. For my testing, I used a list of 13 random strings. #!/usr/bin/env python3 import time from multiprocessing.dummy import Pool as ThreadPool, current_process as threadpool_process import requests def ids_to_check(): some_calls() return(id_list) def execute_task(id): url = f"https://myserver.com/todos/{ id }" json_op = s.get(url,verify=False).json() value = json_op['id'] print(str(value) + '-' + str

keep-alive connection with Superagent

余生长醉 提交于 2020-12-29 13:19:28
问题 I'm running a node.js server A which uses superagent to issue HTTP requests to another server B. I investigated the request on server B and saw the the header connection being close and the httpVersion being 1.1 : var http = require('http'); var request = require('superagent'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('req.httpVersion seen on server:' + req.httpVersion); res.write('\nreq.headers.connection seen on server:' + req

gRPC Android Client losing connection “too many pings”

老子叫甜甜 提交于 2020-07-19 11:28:10
问题 Android grpc client is receiving GOAWAY from server with "too many pings" error. Now I realise that this is probably a server side issue, but I think the issue is that the client channel settings do not match that of the servers. I have a C# gRPC server with the following settings: List<ChannelOption> channelOptions = new List<ChannelOption>(); channelOptions.Add(new ChannelOption("GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS", 1000)); channelOptions.Add(new ChannelOption("GRPC_ARG

Python urllib3: close idle connection after some time

怎甘沉沦 提交于 2020-07-08 11:00:57
问题 Is there a way to tell Python urllib3 to not reuse idle connections after some period of time, and instead to close them? Looking in https://urllib3.readthedocs.io/en/latest/reference/index.html#module-urllib3.connectionpool doesn't seem to show anything relevant. 回答1: Remember: A connection pool is a cache of database connections maintained so that the connections can be "reused" when future requests to the database are required. You can do this is many ways (I guess): Set retries to one.

Python urllib3: close idle connection after some time

你离开我真会死。 提交于 2020-07-08 11:00:22
问题 Is there a way to tell Python urllib3 to not reuse idle connections after some period of time, and instead to close them? Looking in https://urllib3.readthedocs.io/en/latest/reference/index.html#module-urllib3.connectionpool doesn't seem to show anything relevant. 回答1: Remember: A connection pool is a cache of database connections maintained so that the connections can be "reused" when future requests to the database are required. You can do this is many ways (I guess): Set retries to one.