# Master election takes minutes

**URL:** <https://discuss.elastic.co/t/master-election-takes-minutes/272303>\
**Category:** Elasticsearch\
**Created:** [May 6, 2021, 1:25pm UTC](https://discuss.elastic.co/t/master-election-takes-minutes/272303 "2021-05-06T13:25:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jacknl](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jacknl](https://discuss.elastic.co/u/jacknl)\
**Post date:** [May 7, 2021, 9:36am UTC](https://discuss.elastic.co/t/master-election-takes-minutes/272303/3 "2021-05-07T09:36:33Z")

</div>

Thanks, David. It's really appreciated. I had read [your previous post](https://discuss.elastic.co/t/master-role-does-not-switch-automaticaly/214213/7) but wasn't quite sure if it was a similar situation.

Do you still suggest increasing `cluster.publish.timeout` and/or `cluster.join.timeout` as a temporary workaround until we upgrade?

I was aware that we have a suboptimal number of shards for several of our indices. But I did not realise that the number of indices has this much of an impact on writing the cluster state to disk.

I am a bit surprised that writing a few kB per index would take this much time and that my disks are too slow. Especially because the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state-publishing.html) says that "cluster state updates are typically published as diffs to the previous cluster state".

---

_[View the full topic](https://discuss.elastic.co/t/master-election-takes-minutes/272303)._
