Kubernetes request to service timeout value
Kubernetes request to service timeout value
We are using Kubernetes v1.9.5
on bare metal, deployed with kubespray
, network driver - flannel
.
v1.9.5
kubespray
flannel
When doing HTTP request from pod to another service, if that service has no endpoint, request hangs for exactly 130 seconds (I checked in via NodeJS
net library and via curl
).
NodeJS
curl
Where this value comes from?
We noticed in while writing retries that try to establish connection to service.
Any help appreciated.
1 Answer
1
It looks like the iptables will DROP packet if its destined to a non-existent end-point and DROP will never send a message back to the requester (DROP/REJECT) . This will result in retires from requester.
Retries depends on the parameter net.ipv4.tcp_syn_retries
and by default its 6 in CentOS-7
net.ipv4.tcp_syn_retries
When I set net.ipv4.tcp_syn_retries=1
in the minion where the requester pod runs , the timeout happens in 3 seconds instead of the 2m 7.23s
net.ipv4.tcp_syn_retries=1
I hope this clarifies why curl or any port connect request hangs for long time if the request is for a non-existent endpoint.
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.