# How many shards can help deliver the best performance？

**URL:** <https://discuss.elastic.co/t/how-many-shards-can-help-deliver-the-best-performance/43464>\
**Category:** Elasticsearch\
**Created:** [March 4, 2016, 2:59am UTC](https://discuss.elastic.co/t/how-many-shards-can-help-deliver-the-best-performance/43464 "2016-03-04T02:59:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lp\_z](https://avatars.discourse-cdn.com/v4/letter/l/ecae2f/32.png) [@lp\_z](https://discuss.elastic.co/u/lp_z)\
**Post date:** [March 4, 2016, 2:59am UTC](https://discuss.elastic.co/t/how-many-shards-can-help-deliver-the-best-performance/43464/1 "2016-03-04T02:59:26Z")

</div>

Hi All,  
Here is my environmental  
CPU 8core  
Memory 16G  
OS centOS 7  
elasticsearch 2.1 one-node

I used the same query in the following conditions：  
40W data in one shard，take 3 seconds for searching.  
90W data in 5 shards ，take 3 seconds for searching  
90W data in10 shards ，take 3 seconds for searching

I also try 20 shards.  
With the increase in the number of shards， the searching time remain unchanged.

This is my query .

```
curl -XPOST "127.0.0.1:9200/sflow_1452009600/sflow/_search?pretty" -d '
{
 "size":0,
    "query": {
        "filtered":{
            "filter":{
                "range": { "@timestamp": {"gte":1450256300,"lte":1464258400}}
            }
        }
    },
  "aggs":
    {
      "SRC_DST":
   {
          "terms": {"script": "[doc.SRC_IP.value, doc.DST_IP.value].join(\"-\")","size": 2,"shard_size":0, "order": {"sum_bits": "desc"}},
          "aggs": { "sum_bits": { "sum": {"field": "BYTES"} } }
        }
    }
}'

```

Have anyone do the testing in the same configuration ?  
Is this normal or do I need to change Something.

Thanks,  
Judy

---

<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:** [March 4, 2016, 3:58am UTC](https://discuss.elastic.co/t/how-many-shards-can-help-deliver-the-best-performance/43464/2 "2016-03-04T03:58:58Z")

</div>

> [@lp\_z](#):
>
> 40W data

What's the W meant to represent?

Also given you have a script in your query, it's not going to be super fast.

---

<div class="post-metadata">

**Author:** ![lp\_z](https://avatars.discourse-cdn.com/v4/letter/l/ecae2f/32.png) [@lp\_z](https://discuss.elastic.co/u/lp_z)\
**Post date:** [March 4, 2016, 5:49am UTC](https://discuss.elastic.co/t/how-many-shards-can-help-deliver-the-best-performance/43464/3 "2016-03-04T05:49:02Z")

</div>

40W means 400000

---

<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 5, 2017, 11:11pm UTC](https://discuss.elastic.co/t/how-many-shards-can-help-deliver-the-best-performance/43464/4 "2017-07-05T23:11:23Z")

</div>


