-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kube-proxy ProxyLoop() contends on mutex with iptables sync loop #11977
Comments
With further analysis anything run good on docker part, checking directly the virtual ip address of docker pod always return in time! |
Open question : Skydns might handle pod ip as RR dns A record and all that mess will run smoother. Currently I do have dbs with replication, php with some dependancies to other pods, so you can easily understand how high I'm dependant to a clean and really fast network. I've got ~150 services wich lead to 2s with complete network stale, with 375 services it would take the whole refresh loop, and with more services what would happens? I've got the feeling that generating a complete ipfile and injecting with iprestore will do less harm. |
http://docs.k8s.io/v1.0/user-guide/services.html#why-not-use-round-robin-dns There is not enough information here to properly address your issue. What Kubernetes version, what OS, what cloud, how did you do setup, what network overlay if any, etc. Running on my own cluster, for example:
and
|
@thockin you're not running enough samples, to be sure to have a least one pass on kube-proxy refresh. You'll have to run more than 5000 loops. That's why I filtered on time > 1s. Good points on DNS RR. But it's the easiest way to handle multiple endpoints while real balancing is WIP. So I'm on a full 1.0.1 cluster with 1 master, 12 nodes : 11 coreos, 1 debian. The gce nodes are all on same power : n1-highmem-2. The installation is from a kube-up on release 1.0.1 package. I've got: No overlays , nothing special, I stood as close as possible to upstream, even on the coreos installation. We are not live now, so I still have time to debug anything you want and test whatever would make differences. |
We know kube-proxy has a long-tail problem, but it's not usually root@af0e40b6c43d:/# for i in $(seq 1 100000); do curl -Ik On Wed, Jul 29, 2015 at 11:50 AM, bnprss notifications@github.com wrote:
|
I was thinking more on iptables-restore, and I don't really see how to use kube-proxy reads state of -t nat On Wed, Jul 29, 2015 at 5:58 PM, Tim Hockin notifications@github.com
|
@thockin I made some test, and I'm now sure: no traffic is handled at all while kube-proxy iptables loop, checked by logging on level 5 . I see three potential solutions :
Advantages:
Advantages:
Network transaction shouldn't be stop anytime in the kube-proxy process. |
I'll post the following PR that cover the 1st case : time to check : for i in $(seq 1 100000); do curl -Ik 10.0.249.163 -s -w '%{time_total}' -o /dev/null; echo; done | sort | uniq -c With the PR and ~420 netfilter rules to check I get the following histogram (100 000 samples is a long run :) ): Without the PR and 5000 samples : Low number of curl > 1s due to checks running in seq. By the way, the time to complete the run will be a good indicator. |
So the real issue is that ProxyLoop() calls proxier.getServiceInfo(), which A better design would be store an atomic value in the ServiceInfo struct I'm going to re-title this bug to reflect the problem On Thu, Jul 30, 2015 at 3:16 AM, bnprss notifications@github.com wrote:
|
It is really a simple ugly workaround focused on the big loop that takes ages to complete, I agree with that. And I assume it's mitigation role. My knowledge of go wont't help for your proposal, as you might have understood, it was the first time I code in that language and as a SysAdmin my skills are also limited in development tasks. Could you take care of it? |
I'll see if I can throw something together. Do you want me to take over the lock mitigation too, or do you want to do that? It should be a relatively simple change given that you already found the place to do that. |
No, it will be ok for the lock mitigation I figured out why red light cames from shippable and travis. And will comment on the PR. Thank you for taking care of the mid term solution. |
This should make throughput better on the userspace proxier. Fixes kubernetes#11977
This should make throughput better on the userspace proxier. Fixes kubernetes#11977
By looking why sometime my sites magicaly slow down for a short period of time I got that :
each 5 seconds dns query are jumping from < 2 ms to that ...
until [[ 0 -eq 1 ]]; do dig mysql-change @10.0.0.10 | grep -E "time: [0-9]{3,}" && date; done
;; Query time: 2187 msec
Wed Jul 29 13:39:31 UTC 2015
;; Query time: 2114 msec
Wed Jul 29 13:39:36 UTC 2015
;; Query time: 1890 msec
Wed Jul 29 13:39:41 UTC 2015
;; Query time: 1874 msec
Wed Jul 29 13:39:46 UTC 2015
;; Query time: 1930 msec
Wed Jul 29 13:39:51 UTC 2015
;; Query time: 1942 msec
Wed Jul 29 13:39:56 UTC 2015
;; Query time: 2350 msec
Wed Jul 29 13:40:01 UTC 2015
;; Query time: 2469 msec
Wed Jul 29 13:40:06 UTC 2015
;; Query time: 1898 msec
Wed Jul 29 13:40:11 UTC 2015
;; Query time: 2083 msec
Wed Jul 29 13:40:16 UTC 2015
;; Query time: 2110 msec
Wed Jul 29 13:40:21 UTC 2015
;; Query time: 1921 msec
Wed Jul 29 13:40:26 UTC 2015
;; Query time: 2023 msec
Wed Jul 29 13:40:31 UTC 2015
;; Query time: 1836 msec
Wed Jul 29 13:40:36 UTC 2015
;; Query time: 2182 msec
Wed Jul 29 13:40:41 UTC 2015
;; Query time: 2079 msec
Wed Jul 29 13:40:46 UTC 2015
;; Query time: 2066 msec
Wed Jul 29 13:40:51 UTC 2015
;; Query time: 1905 msec
Wed Jul 29 13:40:56 UTC 2015
;; Query time: 1999 msec
Wed Jul 29 13:41:01 UTC 2015
;; Query time: 1855 msec
Wed Jul 29 13:41:06 UTC 2015
;; Query time: 2043 msec
Wed Jul 29 13:41:11 UTC 2015
But it's not over, curl on ip gives me that :
until [[ 0 -eq 1 ]]; do curl -I 10.0.126.115:9200 -s -w '%{time_total}' -o /dev/null | grep -E "^[1-9]" && date; done
2.083
Wed Jul 29 13:50:16 UTC 2015
2.247
Wed Jul 29 13:50:21 UTC 2015
1.874
Wed Jul 29 13:50:26 UTC 2015
2.019
Wed Jul 29 13:50:31 UTC 2015
2.006
Wed Jul 29 13:50:36 UTC 2015
1.718
Wed Jul 29 13:50:41 UTC 2015
1.954
Wed Jul 29 13:50:46 UTC 2015
2.065
Wed Jul 29 13:50:51 UTC 2015
1.896
Wed Jul 29 13:50:56 UTC 2015
1.968
Wed Jul 29 13:51:01 UTC 2015
1.556
Wed Jul 29 13:51:05 UTC 2015
There is something wrong in the way kube-proxy is working/updating. It's a real source of troubles on my side.
The text was updated successfully, but these errors were encountered: