# Too many open files

**URL:** <https://discuss.elastic.co/t/too-many-open-files/8668>\
**Category:** Elasticsearch\
**Created:** [August 8, 2012, 9:59am UTC](https://discuss.elastic.co/t/too-many-open-files/8668 "2012-08-08T09:59:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcin\_Dojwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcin_dojwa/32/2307_2.png) [@Marcin\_Dojwa](https://discuss.elastic.co/u/Marcin_Dojwa)\
**Post date:** [August 8, 2012, 9:59am UTC](https://discuss.elastic.co/t/too-many-open-files/8668/1 "2012-08-08T09:59:42Z")

</div>

Hi,

How to prevent the following error:  
Failed to accept a connection.  
java.io.IOException: Too many open files

I have max open descriptors set to 65535. I have currently 640 indices,  
each has 3 document types.

Thanks for help.

Best regards.

---

<div class="post-metadata">

**Author:** ![Rafal\_Kuc\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafal_kuc_3/32/799_2.png) [@Rafal\_Kuc\_3](https://discuss.elastic.co/u/Rafal_Kuc_3)\
**Post date:** [August 8, 2012, 10:06am UTC](https://discuss.elastic.co/t/too-many-open-files/8668/2 "2012-08-08T10:06:24Z")

</div>

Hello!

Increase the number of max opened files allowed. 640 indices are quite a big number, considering that you can have multiple shards for each and multiple replicas too.

_--_

Regards,

Rafał Kuć

Sematext :: [http://sematext.com/](http://sematext.com/) _:: Solr - Lucene - Nutch - ElasticSearch_

Hi,

How to prevent the following error:

Failed to accept a connection.

java.io.IOException: Too many open files

I have max open descriptors set to 65535. I have currently 640 indices, each has 3 document types.

Thanks for help.

Best regards.

---

<div class="post-metadata">

**Author:** ![Marcin\_Dojwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcin_dojwa/32/2307_2.png) [@Marcin\_Dojwa](https://discuss.elastic.co/u/Marcin_Dojwa)\
**Post date:** [August 8, 2012, 11:04am UTC](https://discuss.elastic.co/t/too-many-open-files/8668/3 "2012-08-08T11:04:56Z")

</div>

Hi, thanks for the answer. Now I consider switching indices and document  
types. Currently I have increasing number of indices containing 3 documents  
types (always the same). Would it be better to use only 3 indices  
containing increasing number of document types (up to eg. 1 mln document  
types) ?

Best regards.

2012/8/8 Rafał Kuć [r.kuc@solr.pl](mailto:r.kuc@solr.pl)

> Hello!
> 
> Increase the number of max opened files allowed. 640 indices are quite a  
> big number, considering that you can have multiple shards for each and  
> multiple replicas too.
> 
> \*--  
> Regards,  
> Rafał Kuć  
> Sematext :: _[http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch -  
> Elasticsearch
> 
> - 
> 
> Hi,
> 
> How to prevent the following error:  
> Failed to accept a connection.  
> java.io.IOException: Too many open files
> 
> I have max open descriptors set to 65535. I have currently 640 indices,  
> each has 3 document types.
> 
> Thanks for help.
> 
> Best regards.

---

<div class="post-metadata">

**Author:** ![Rafal\_Kuc\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafal_kuc_3/32/799_2.png) [@Rafal\_Kuc\_3](https://discuss.elastic.co/u/Rafal_Kuc_3)\
**Post date:** [August 8, 2012, 11:12am UTC](https://discuss.elastic.co/t/too-many-open-files/8668/4 "2012-08-08T11:12:52Z")

</div>

Hello!

I think I would go for three indices with multiple types of documents, but that also depend on your data structure and what you try to achieve. Having three indices has its pros and cons, but having a million indices (if I understand you correctly, that can happen in the future right ?) in the cluster can lead to resource allocation problems. With three indices, you can use routing based on the document type and in that case place documents of the same type in the same shard. This can also be helpful in some situations.

_--_

Regards,

Rafał Kuć

Sematext :: [http://sematext.com/](http://sematext.com/) _:: Solr - Lucene - Nutch - ElasticSearch_

Hi, thanks for the answer. Now I consider switching indices and document types. Currently I have increasing number of indices containing 3 documents types (always the same). Would it be better to use only 3 indices containing increasing number of document types (up to eg. 1 mln document types) ?

Best regards.

2012/8/8 Rafał Kuć \<[r.kuc@solr.pl](mailto:r.kuc@solr.pl)\>

Hello!

Increase the number of max opened files allowed. 640 indices are quite a big number, considering that you can have multiple shards for each and multiple replicas too.

_--_

Regards,

Rafał Kuć

Sematext :: [http://sematext.com/](http://sematext.com/) _:: Solr - Lucene - Nutch - ElasticSearch_

Hi,

How to prevent the following error:

Failed to accept a connection.

java.io.IOException: Too many open files

I have max open descriptors set to 65535. I have currently 640 indices, each has 3 document types.

Thanks for help.

Best regards.

---

<div class="post-metadata">

**Author:** ![Marcin\_Dojwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcin_dojwa/32/2307_2.png) [@Marcin\_Dojwa](https://discuss.elastic.co/u/Marcin_Dojwa)\
**Post date:** [August 8, 2012, 11:58am UTC](https://discuss.elastic.co/t/too-many-open-files/8668/5 "2012-08-08T11:58:06Z")

</div>

Thank you Rafał for all your help.

Best regards.

2012/8/8 Rafał Kuć [r.kuc@solr.pl](mailto:r.kuc@solr.pl)

> Hello!
> 
> I think I would go for three indices with multiple types of documents, but  
> that also depend on your data structure and what you try to achieve. Having  
> three indices has its pros and cons, but having a million indices (if I  
> understand you correctly, that can happen in the future right ?) in the  
> cluster can lead to resource allocation problems. With three indices, you  
> can use routing based on the document type and in that case place documents  
> of the same type in the same shard. This can also be helpful in some  
> situations.
> 
> _--  
> Regards,  
> Rafał Kuć  
> Sematext :: \*  
> [http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch - Elasticsearch
> 
> - 
> 
> Hi, thanks for the answer. Now I consider switching indices and document  
> types. Currently I have increasing number of indices containing 3 documents  
> types (always the same). Would it be better to use only 3 indices  
> containing increasing number of document types (up to eg. 1 mln document  
> types) ?
> 
> Best regards.
> 
> 2012/8/8 Rafał Kuć [r.kuc@solr.pl](mailto:r.kuc@solr.pl)  
> Hello!
> 
> Increase the number of max opened files allowed. 640 indices are quite a  
> big number, considering that you can have multiple shards for each and  
> multiple replicas too.
> 
> \*--  
> Regards,  
> Rafał Kuć  
> Sematext :: _[http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch -  
> Elasticsearch
> 
> - 
> 
> Hi,
> 
> How to prevent the following error:  
> Failed to accept a connection.  
> java.io.IOException: Too many open files
> 
> I have max open descriptors set to 65535. I have currently 640 indices,  
> each has 3 document types.
> 
> Thanks for help.
> 
> Best regards.

---

<div class="post-metadata">

**Author:** ![Marcin\_Dojwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcin_dojwa/32/2307_2.png) [@Marcin\_Dojwa](https://discuss.elastic.co/u/Marcin_Dojwa)\
**Post date:** [August 8, 2012, 1:22pm UTC](https://discuss.elastic.co/t/too-many-open-files/8668/6 "2012-08-08T13:22:00Z")

</div>

Is there any other way to use routing based on the document type than using  
'\_routing' field in each query URL ?

Best regards.  
Marcin Dojwa

2012/8/8 Marcin Dojwa [m.dojwa@livechatinc.com](mailto:m.dojwa@livechatinc.com)

> Thank you Rafał for all your help.
> 
> Best regards.
> 
> 2012/8/8 Rafał Kuć [r.kuc@solr.pl](mailto:r.kuc@solr.pl)
> 
> > Hello!
> > 
> > I think I would go for three indices with multiple types of documents,  
> > but that also depend on your data structure and what you try to achieve.  
> > Having three indices has its pros and cons, but having a million indices  
> > (if I understand you correctly, that can happen in the future right ?) in  
> > the cluster can lead to resource allocation problems. With three indices,  
> > you can use routing based on the document type and in that case place  
> > documents of the same type in the same shard. This can also be helpful in  
> > some situations.
> > 
> > _--  
> > Regards,  
> > Rafał Kuć  
> > Sematext :: \*  
> > [http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch - Elasticsearch
> > 
> > - 
> > 
> > Hi, thanks for the answer. Now I consider switching indices and  
> > document types. Currently I have increasing number of indices containing 3  
> > documents types (always the same). Would it be better to use only 3 indices  
> > containing increasing number of document types (up to eg. 1 mln document  
> > types) ?
> > 
> > Best regards.
> > 
> > 2012/8/8 Rafał Kuć [r.kuc@solr.pl](mailto:r.kuc@solr.pl)  
> > Hello!
> > 
> > Increase the number of max opened files allowed. 640 indices are quite a  
> > big number, considering that you can have multiple shards for each and  
> > multiple replicas too.
> > 
> > \*--  
> > Regards,  
> > Rafał Kuć  
> > Sematext :: _[http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch -  
> > Elasticsearch
> > 
> > - 
> > 
> > Hi,
> > 
> > How to prevent the following error:  
> > Failed to accept a connection.  
> > java.io.IOException: Too many open files
> > 
> > I have max open descriptors set to 65535. I have currently 640 indices,  
> > each has 3 document types.
> > 
> > Thanks for help.
> > 
> > Best regards.

---

<div class="post-metadata">

**Author:** ![Rafal\_Kuc\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafal_kuc_3/32/799_2.png) [@Rafal\_Kuc\_3](https://discuss.elastic.co/u/Rafal_Kuc_3)\
**Post date:** [August 8, 2012, 6:52pm UTC](https://discuss.elastic.co/t/too-many-open-files/8668/7 "2012-08-08T18:52:58Z")

</div>

Hello!

Take a look at routing field Marcin - [http://www.elasticsearch.org/guide/reference/mapping/routing-field.html](http://www.elasticsearch.org/guide/reference/mapping/routing-field.html)

_--_

Regards,

Rafał Kuć

Sematext :: [http://sematext.com/](http://sematext.com/) _:: Solr - Lucene - Nutch - ElasticSearch_

Is there any other way to use routing based on the document type than using '\_routing' field in each query URL ?

Best regards.

Marcin Dojwa

2012/8/8 Marcin Dojwa \<[m.dojwa@livechatinc.com](mailto:m.dojwa@livechatinc.com)\>

Thank you Rafał for all your help.

Best regards.

2012/8/8 Rafał Kuć \<[r.kuc@solr.pl](mailto:r.kuc@solr.pl)\>

Hello!

I think I would go for three indices with multiple types of documents, but that also depend on your data structure and what you try to achieve. Having three indices has its pros and cons, but having a million indices (if I understand you correctly, that can happen in the future right ?) in the cluster can lead to resource allocation problems. With three indices, you can use routing based on the document type and in that case place documents of the same type in the same shard. This can also be helpful in some situations.

_--_

Regards,

Rafał Kuć

Sematext ::

[http://sematext.com/](http://sematext.com/) _:: Solr - Lucene - Nutch - ElasticSearch_

Hi, thanks for the answer. Now I consider switching indices and document types. Currently I have increasing number of indices containing 3 documents types (always the same). Would it be better to use only 3 indices containing increasing number of document types (up to eg. 1 mln document types) ?

Best regards.

2012/8/8 Rafał Kuć \<[r.kuc@solr.pl](mailto:r.kuc@solr.pl)\>

Hello!

Increase the number of max opened files allowed. 640 indices are quite a big number, considering that you can have multiple shards for each and multiple replicas too.

_--_

Regards,

Rafał Kuć

Sematext :: [http://sematext.com/](http://sematext.com/) _:: Solr - Lucene - Nutch - ElasticSearch_

Hi,

How to prevent the following error:

Failed to accept a connection.

java.io.IOException: Too many open files

I have max open descriptors set to 65535. I have currently 640 indices, each has 3 document types.

Thanks for help.

Best regards.

---

<div class="post-metadata">

**Author:** ![Marcin\_Dojwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcin_dojwa/32/2307_2.png) [@Marcin\_Dojwa](https://discuss.elastic.co/u/Marcin_Dojwa)\
**Post date:** [August 9, 2012, 5:45am UTC](https://discuss.elastic.co/t/too-many-open-files/8668/8 "2012-08-09T05:45:13Z")

</div>

Thank you Rafał.

Best regards.

2012/8/8 Rafał Kuć [r.kuc@solr.pl](mailto:r.kuc@solr.pl)

> Hello!
> 
> Take a look at routing field Marcin -  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/routing-field.html)
> 
> \*--  
> Regards,  
> Rafał Kuć  
> Sematext :: _[http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch -  
> Elasticsearch
> 
> - 
> 
> Is there any other way to use routing based on the document type than  
> using '\_routing' field in each query URL ?
> 
> Best regards.  
> Marcin Dojwa
> 
> 2012/8/8 Marcin Dojwa [m.dojwa@livechatinc.com](mailto:m.dojwa@livechatinc.com)  
> Thank you Rafał for all your help.
> 
> Best regards.
> 
> 2012/8/8 Rafał Kuć [r.kuc@solr.pl](mailto:r.kuc@solr.pl)  
> Hello!
> 
> I think I would go for three indices with multiple types of documents, but  
> that also depend on your data structure and what you try to achieve. Having  
> three indices has its pros and cons, but having a million indices (if I  
> understand you correctly, that can happen in the future right ?) in the  
> cluster can lead to resource allocation problems. With three indices, you  
> can use routing based on the document type and in that case place documents  
> of the same type in the same shard. This can also be helpful in some  
> situations.
> 
> \*--  
> Regards,  
> Rafał Kuć  
> Sematext ::  
> _[http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch - Elasticsearch
> 
> - 
> 
> Hi, thanks for the answer. Now I consider switching indices and document  
> types. Currently I have increasing number of indices containing 3 documents  
> types (always the same). Would it be better to use only 3 indices  
> containing increasing number of document types (up to eg. 1 mln document  
> types) ?
> 
> Best regards.
> 
> 2012/8/8 Rafał Kuć [r.kuc@solr.pl](mailto:r.kuc@solr.pl)  
> Hello!
> 
> Increase the number of max opened files allowed. 640 indices are quite a  
> big number, considering that you can have multiple shards for each and  
> multiple replicas too.
> 
> \*--  
> Regards,  
> Rafał Kuć  
> Sematext :: _[http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch -  
> Elasticsearch
> 
> - 
> 
> Hi,
> 
> How to prevent the following error:  
> Failed to accept a connection.  
> java.io.IOException: Too many open files
> 
> I have max open descriptors set to 65535. I have currently 640 indices,  
> each has 3 document types.
> 
> Thanks for help.
> 
> Best regards.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:17am UTC](https://discuss.elastic.co/t/too-many-open-files/8668/9 "2017-07-06T03:17:01Z")

</div>


