# Scalability and creating 1 index per user

**URL:** https://discuss.elastic.co/t/scalability-and-creating-1-index-per-user/16018
**Category:** Elasticsearch
**Created:** [February 25, 2014, 9:46pm UTC](https://discuss.elastic.co/t/scalability-and-creating-1-index-per-user/16018 "2014-02-25T21:46:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Neera\_Vats](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@Neera\_Vats](https://discuss.elastic.co/u/Neera_Vats)
#### Post date: [February 25, 2014, 9:46pm UTC](https://discuss.elastic.co/t/scalability-and-creating-1-index-per-user/16018/1 "2014-02-25T21:46:00Z")

</div>

Hi All,  
I am exploring elastic search to create one index per user instead of one  
big index for all the users. Each index would be about 6G.  
I am wondering if anyone has tried it and how would it scale?

I couldn't find that elastic search has limit on maximum number of indices.  
Is it safe/recommended to have say 20K indices for 20K users? Would it  
architecture scale well?

Also, if start with say a 5 nodes cluster now, and add more nodes as I need  
them, does ES redistributes its shards every time I add new nodes? How  
newly added nodes are utilized in a cluster?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/846e3f85-97b6-494b-9ffb-67c9ec3f66ab%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/846e3f85-97b6-494b-9ffb-67c9ec3f66ab%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [February 25, 2014, 9:52pm UTC](https://discuss.elastic.co/t/scalability-and-creating-1-index-per-user/16018/2 "2014-02-25T21:52:01Z")

</div>

On Tue, Feb 25, 2014 at 4:46 PM, ESUser [neeravats@gmail.com](mailto:neeravats@gmail.com) wrote:

> Hi All,  
> I am exploring Elasticsearch to create one index per user instead of one  
> big index for all the users. Each index would be about 6G.  
> I am wondering if anyone has tried it and how would it scale?
> 
> I couldn't find that Elasticsearch has limit on maximum number of  
> indices. Is it safe/recommended to have say 20K indices for 20K users?  
> Would it architecture scale well?

I'm running 1107 indexes right now. Some of the cluster actions are a bit  
slower then I'd like but I think that is better in 1.0. I don't think it'd  
work well an order of magnitude larger but I could be wrong.

> Also, if start with say a 5 nodes cluster now, and add more nodes as I  
> need them, does ES redistributes its shards every time I add new nodes? How  
> newly added nodes are utilized in a cluster?

It'll smooth the shards out across the new nodes. There is configuration  
for how many concurrent moves can take place and how much bandwidth is ok  
per move. The defaults are a bit slow especially if you have fast network  
and disks.

Nik

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1Atp5piP5bOYqaxnMPw6iW7yKTY8%3DxQhmO56GCcUsa\_A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1Atp5piP5bOYqaxnMPw6iW7yKTY8%3DxQhmO56GCcUsa_A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 25, 2014, 9:54pm UTC](https://discuss.elastic.co/t/scalability-and-creating-1-index-per-user/16018/3 "2014-02-25T21:54:31Z")

</div>

20K is a lot of indexes, probably too many as ES will need to maintain  
state about each of those in memory which could mean you have nothing left  
for caching indexed data!  
You might want to look at  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/customizing-your-document-routing/instead),  
that way you can reduce your index count but still gain the same  
usability outcome.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 26 February 2014 08:52, Nikolas Everett [nik9000@gmail.com](mailto:nik9000@gmail.com) wrote:

> On Tue, Feb 25, 2014 at 4:46 PM, ESUser [neeravats@gmail.com](mailto:neeravats@gmail.com) wrote:
> 
> > Hi All,  
> > I am exploring Elasticsearch to create one index per user instead of one  
> > big index for all the users. Each index would be about 6G.  
> > I am wondering if anyone has tried it and how would it scale?
> > 
> > I couldn't find that Elasticsearch has limit on maximum number of  
> > indices. Is it safe/recommended to have say 20K indices for 20K users?  
> > Would it architecture scale well?
> 
> I'm running 1107 indexes right now. Some of the cluster actions are a bit  
> slower then I'd like but I think that is better in 1.0. I don't think it'd  
> work well an order of magnitude larger but I could be wrong.
> 
> > Also, if start with say a 5 nodes cluster now, and add more nodes as I  
> > need them, does ES redistributes its shards every time I add new nodes? How  
> > newly added nodes are utilized in a cluster?
> 
> It'll smooth the shards out across the new nodes. There is configuration  
> for how many concurrent moves can take place and how much bandwidth is ok  
> per move. The defaults are a bit slow especially if you have fast network  
> and disks.
> 
> Nik
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1Atp5piP5bOYqaxnMPw6iW7yKTY8%3DxQhmO56GCcUsa\_A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1Atp5piP5bOYqaxnMPw6iW7yKTY8%3DxQhmO56GCcUsa_A%40mail.gmail.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624ZbwOJarNCT8wrEzi047V8GCP3mYfh\_2X7MQOFrb4QbCg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624ZbwOJarNCT8wrEzi047V8GCP3mYfh_2X7MQOFrb4QbCg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)
#### Post date: [March 12, 2014, 3:37am UTC](https://discuss.elastic.co/t/scalability-and-creating-1-index-per-user/16018/4 "2014-03-12T03:37:29Z")

</div>

Hi,

I know some users of SPM for Elasticsearch have clusters with many  
thousands indexes (and growing), each with 5+ shards. They've been using  
SPM for man months now, plus they are our clients, so I've had the chance  
to see their servers and metrics and can tell you that I don't see any  
other metric growing to dangerous level just because the number of their  
indexes is growing - CPU is low, JVM GC is low, etc. But, of course, there  
are a ton of factors involved, such as whether and how much these indexes  
are actually being searches, and I don't recall that info off the top of my  
head. ~10 years ago I had a single server with \>300K non-trivial Lucene  
indexes that bots were crawling like crazy.... but I implemented something  
that closed unused indices and opened them on demand and that's what made  
it possible for this system to survive. Maybe this could work for you, too.

## Otis

Performance Monitoring \* Log Analytics \* Search Analytics  
Solr & Elasticsearch Support \* [http://sematext.com/](http://sematext.com/)

On Tuesday, February 25, 2014 4:54:31 PM UTC-5, Mark Walkom wrote:

> 20K is a lot of indexes, probably too many as ES will need to maintain  
> state about each of those in memory which could mean you have nothing left  
> for caching indexed data!  
> You might want to look at  
> [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/blog/customizing-your-document-routing/instead), that way you can reduce your index count but still gain the same  
> usability outcome.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com) \<javascript:\>  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 26 February 2014 08:52, Nikolas Everett \<[nik...@gmail.com](mailto:nik...@gmail.com) \<javascript:\>
> 
> > wrote:
> 
> > On Tue, Feb 25, 2014 at 4:46 PM, ESUser \<[neer...@gmail.com](mailto:neer...@gmail.com) \<javascript:\>\>wrote:
> > 
> > > Hi All,  
> > > I am exploring Elasticsearch to create one index per user instead of  
> > > one big index for all the users. Each index would be about 6G.  
> > > I am wondering if anyone has tried it and how would it scale?
> > > 
> > > I couldn't find that Elasticsearch has limit on maximum number of  
> > > indices. Is it safe/recommended to have say 20K indices for 20K users?  
> > > Would it architecture scale well?
> > 
> > I'm running 1107 indexes right now. Some of the cluster actions are a  
> > bit slower then I'd like but I think that is better in 1.0. I don't think  
> > it'd work well an order of magnitude larger but I could be wrong.
> > 
> > > Also, if start with say a 5 nodes cluster now, and add more nodes as I  
> > > need them, does ES redistributes its shards every time I add new nodes? How  
> > > newly added nodes are utilized in a cluster?
> > 
> > It'll smooth the shards out across the new nodes. There is configuration  
> > for how many concurrent moves can take place and how much bandwidth is ok  
> > per move. The defaults are a bit slow especially if you have fast network  
> > and disks.
> > 
> > Nik
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1Atp5piP5bOYqaxnMPw6iW7yKTY8%3DxQhmO56GCcUsa\_A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1Atp5piP5bOYqaxnMPw6iW7yKTY8%3DxQhmO56GCcUsa_A%40mail.gmail.com)  
> > .
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f8907862-ac1d-447b-8cdd-2df948ed6579%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f8907862-ac1d-447b-8cdd-2df948ed6579%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:44am UTC](https://discuss.elastic.co/t/scalability-and-creating-1-index-per-user/16018/5 "2017-07-06T01:44:00Z")

</div>


