-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
spike in ETCD IO: raft apply, peer traffic #7981
Comments
Do you have server logs during that spikes? That would be helpful for us to debug. Thanks! |
@gyuho I guess there must be something wrong with the storage side(in source code).
|
@armstrongli What's the etcd version? There was memory leak issue, if you use etcd <=3.1.4. https://github.com/coreos/etcd/blob/master/NEWS#L7 |
Yes. it's < 3.1.4. |
It seems there are a lot of raft proposals received around 06:46. So leader sent out more data to followers. that is expected. RPC is not increased, but it only tracks v3 rpc. Probably you have v2 application? Please always provide server logs of ALL members. |
All the ETCD members are V3, and all the |
@armstrongli Then I do not understand where are these proposal came from. Your guess does not seem correct. Clearly it was the proposals causing the peer traffic spikes, not the internal syncing. I still need the log to confirm. |
@xiang90 what is the |
@xiang90 Also, in the presented dashboard, there is also |
I am in the same organization with @armstrongli , for now, we actually see two major issues with our ETCD cluster:
We are not sure whether these two issues are related or not. |
@xiang90 The leader logs and member logs : etcd.log.2017-05-23.22.leader.tar.gz |
@armstrongli I need the log that corresponds to the graph. The log you provided are from 22:00 to 23:00, not 08:00 to 20:00. Please provide useful information. It is really hard for me to understand what you want and to interpret the data you provided. It is a waste of time for both side if the information is not accurate. |
The graph is in Beijing time. And the log is in UTC time. |
@xiang90 The logs are for the graph I write in the issue description. |
@armstrongli Can you please convert the timestamp so that they matches? |
I'm still not sure about your case, but in some extreme cases, etcd's batched append strategy would be able to cause high spikes. It is because etcd batches proposals (almost equal to requests from clients) into a single AppendEntries(). This strategy improves both of throughput and latency significantly for ordinary workloads. However, I think that the strategy can make too large delay if the number of proposal in an interval is extremely large because current etcd doesn't provide a parameter for tuning the batching strategy. But please note that I'm not sure about the problem. I've never seen problems like your case. https://github.com/mitake/etcd/tree/batch-append-limit in this branch you can find a new option @xiang90 how do you think about monitoring the numbers of appended entries? I can work on it. |
I can confirm trom the log, there was no snapshot transfer or election happened. There is a proposal spike which caused the io spike as I mentioned. Do you enable auth for the cluster? |
If you look at the RPC rate, it is actually very low. 80 rpcs per seconds. but the proposal rate is high. I am wondering if auth retry causes that. |
@xiang90 ah yes, rpc rate isn't high at all, I missed it. I'll also check the auth retry. |
@mitake Yea... The 80k pending proposal is just crazy. I do not know what triggered it. |
@mitake I believe they run etcd 3.0.15. I remember we fixed something auth retry related? /cc @heyitsanthony |
No. The auth is not enabled. |
@armstrongli Not sure what was going on then. Something was hitting etcdv2 api pretty hard is my best guess. |
There're no application reaching etcd except kube-apiserver. And all the apiservers are using |
@armstrongli if you have a time, could you try this commit: mitake@f83d5a2 ? If you append a new option like this BTW how many nodes does your k8s cluster have? |
@mitake we have 200 nodes, 3000 pods, etc. |
So from the dashboard, etcd node keeps doing proposal during that time with large entry commit. How can we know where these proposal from? |
monitor you applications. etcd does not support audit at the moment. |
cURL etcd at {endpoint}/metrics. there will be some v2 related metrics: https://github.com/coreos/etcd/blob/master/Documentation/v2/metrics.md#http-requests One thing to notice is that the dashboard setup might be incorrect too. So the actual RPC rate might not be what you showed us on the dashboard. We are not sure what really happened still. |
Monitor for what metrics of my application? The application talking to etcd is kube-apiserver. We have do audit of our apiserver request, it is normal as usual. |
@xinxiaogang You need to monitor what requests your application sent to etcd, the dababase. not what requests your application received. that part has nothing to do with etcd directly. I have no idea where these proposals coming from. etcd will not generate proposals out of nothing... again, i am also not sure if the graph you guys provided are accurate. that is something you have to figure out. we do not really have enough data to help you. |
@xiang90 Is there a way or metrics I can get from etcd of the incoming requests from application? I know etcd peers also use http to communicate, how to exclude the peer talk while only leave the application call? |
as i mentioned above, you should read https://github.com/coreos/etcd/blob/master/Documentation/v2/metrics.md#http-requests.
it answers your question. |
for v3 metrics, read the doc here https://github.com/coreos/etcd/blob/master/Documentation/metrics.md |
We are running out etcd on v3, so we should get the v3 metrics, correct? |
There is only method GET in the metrics?
|
@xinxiaogang can you paste all the metrics to here? |
of all your servers |
we reproduced this on our own testing k8s cluster. check #8096. closing this since it is unhelpful. |
We got peer traffic spike in ETCD cluster:
![screen shot 2017-05-25 at 1 24 31 am](https://cloud.githubusercontent.com/assets/8025018/26416574/f2fa7ada-40e8-11e7-88e1-1851ac5e0dc0.png)
After reviewing all the logs of the ETCD members, I didn't find out any abnormal logs.
The guess of this situation is that:
The data transferred is about 500MB.
Every ETCD server has 10 CPUs, and 20GB memory.
The text was updated successfully, but these errors were encountered: