Too Many Open Indices

I run an multi-tenant application on top of ElasticSearch. It dynamically opens and closes indexes when user sessions begin and end. This approach works great... for the most part.

The problem I run into is in situations where too many indexes get opened at once eating up too many resources. This can lead to close index calls themselves timing out, things pretty much go down the tubes at this point.

It would be awesome if:

  1. the intelligent opening and closing of indicies was built into ElasticSearch itself. Not quite sure what this would look like, perhaps an upper-bound could be set on the number of open indices at any given time.
  2. What if there was a way to reset the state of all indices to a closed state? If the server reaches a point where it's critically low on resources, sending the close command to each index fails. This can get you in a state that is difficult to recover from.

Thoughts?

@benjamincoe