I have C# class liblary .NET Framework 4.7.2 who run as plugin for cashbox system(iikofront) in new process.
In work flow program call HTTPS API in Internet.
That http request code
In plugin logs:
[INFO] 2020-10-20 13:40:23 Start SendAsync
[INFO] 2020-10-20 13:40:45 End SendAsync
In server load balancer:
2020-10-20 13:40:34 Start process request
2020-10-20 13:40:36 End process request
PROBLEM
HTTP Request come in server after 10-12 seconds and exist cases when delay 20-30 seconds and Request was abort by HttpClient Timeout. This behavior repeat for first http request, rest requests handled without delay.
QUESTION
What could be the reason for the delay?
INFORMATION
Internet connection fast check in browser
Behavior not repeat in browser if call GET request in browser adress field
HttpClient is created for every request by this code:
public class HttpClientFactory
{
public static HttpClient Get()
{
var client = new HttpClient(
new HttpClientHandler
{
MaxConnectionsPerServer = 100
})
{
Timeout = TimeSpan.FromSeconds(20)
};
client.DefaultRequestHeaders.Add("Accept-Language", "ru");
return client;
}
}