# How to improve facet search performance?

**URL:** <https://discuss.elastic.co/t/how-to-improve-facet-search-performance/12487>\
**Category:** Elasticsearch\
**Created:** [June 20, 2013, 5:49am UTC](https://discuss.elastic.co/t/how-to-improve-facet-search-performance/12487 "2013-06-20T05:49:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![imdhmd](https://avatars.discourse-cdn.com/v4/letter/i/d07c76/32.png) [@imdhmd](https://discuss.elastic.co/u/imdhmd)\
**Post date:** [June 20, 2013, 5:49am UTC](https://discuss.elastic.co/t/how-to-improve-facet-search-performance/12487/1 "2013-06-20T05:49:20Z")

</div>

We are doing performance testing, to identify the right settings for facet  
search.  
The following are the data points. Can you help us identify settings that  
can improve the search response time?

# Context:

Query:  
{  
"facets": {  
"tag": {  
"terms": {  
"field": "category"  
}  
}  
},  
"fields": [  
"title"  
]  
}

So this is basically a facet match all query, chosen to do load testing.  
Note that the field "category" is keyword analyzed

Data:  
Data setup was done using wikipedia river. Index size is 170GB

Setup:  
3 nodes, each with 2 cores and 8GB RAM, 1 Zookeeper node, 3 shards (1 shard  
on each node), no replica

Some existing cluster level settings:  
threadpool for search : fixed, 4 threads, 10000 queue size  
mlockall : true

JAVA\_OPTS from elasticsearch-env.sh  
ES\_JAVA\_OPTS="  
-server  
-Djava.net.preferIPv4Stack=true  
-Des.config=/usr/local/etc/elasticsearch/elasticsearch.yml  
-Xms2299m  
-Xmx2299m  
-Xss256k  
-XX:+UseParNewGC  
-XX:+UseConcMarkSweepGC  
-XX:CMSInitiatingOccupancyFraction=75  
-XX:+UseCMSInitiatingOccupancyOnly  
-XX:+HeapDumpOnOutOfMemoryError"

Current performance:  
Load is: 45 concurrent requests over 2 minutes duration  
Mean response time is: 23.2 seconds

Can you kindly suggest what other what other _elasticsearch settings_ may  
be tweaked to improve facet search performance.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [June 20, 2013, 8:52am UTC](https://discuss.elastic.co/t/how-to-improve-facet-search-performance/12487/2 "2013-06-20T08:52:45Z")

</div>

Hello,

What's the bottleneck? CPU, IO, ...?

It's a good idea to monitor your cluster while you do your load tests (eg:  
with our SPM [http://sematext.com/spm/elasticsearch-performance-monitoring/](http://sematext.com/spm/elasticsearch-performance-monitoring/)),  
so you know what's limiting your performance.

On Thu, Jun 20, 2013 at 8:49 AM, Imdad Ahmed [imdhmd@gmail.com](mailto:imdhmd@gmail.com) wrote:

> We are doing performance testing, to identify the right settings for facet  
> search.  
> The following are the data points. Can you help us identify settings that  
> can improve the search response time?
> 
> # Context:
> 
> Query:  
> {  
> "facets": {  
> "tag": {  
> "terms": {  
> "field": "category"  
> }  
> }  
> },  
> "fields": [  
> "title"  
> ]  
> }
> 
> So this is basically a facet match all query, chosen to do load testing.  
> Note that the field "category" is keyword analyzed
> 
> Data:  
> Data setup was done using wikipedia river. Index size is 170GB
> 
> Setup:  
> 3 nodes, each with 2 cores and 8GB RAM, 1 Zookeeper node, 3 shards (1  
> shard on each node), no replica
> 
> Some existing cluster level settings:  
> threadpool for search : fixed, 4 threads, 10000 queue size  
> mlockall : true
> 
> JAVA\_OPTS from elasticsearch-env.sh  
> ES\_JAVA\_OPTS="  
> -server  
> -Djava.net.preferIPv4Stack=true  
> -Des.config=/usr/local/etc/elasticsearch/elasticsearch.yml  
> -Xms2299m  
> -Xmx2299m  
> -Xss256k  
> -XX:+UseParNewGC  
> -XX:+UseConcMarkSweepGC  
> -XX:CMSInitiatingOccupancyFraction=75  
> -XX:+UseCMSInitiatingOccupancyOnly  
> -XX:+HeapDumpOnOutOfMemoryError"
> 
> Current performance:  
> Load is: 45 concurrent requests over 2 minutes duration  
> Mean response time is: 23.2 seconds
> 
> Can you kindly suggest what other what other _elasticsearch settings_ may  
> be tweaked to improve facet search performance.
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![imdhmd](https://avatars.discourse-cdn.com/v4/letter/i/d07c76/32.png) [@imdhmd](https://discuss.elastic.co/u/imdhmd)\
**Post date:** [June 21, 2013, 6:40am UTC](https://discuss.elastic.co/t/how-to-improve-facet-search-performance/12487/3 "2013-06-21T06:40:56Z")

</div>

Looks like SPM registration is having a downtime. I'm unable to  
register: [https://apps.sematext.com/users-web/register.do](https://apps.sematext.com/users-web/register.do)

On Thursday, June 20, 2013 2:22:45 PM UTC+5:30, Radu Gheorghe wrote:

> Hello,
> 
> What's the bottleneck? CPU, IO, ...?
> 
> It's a good idea to monitor your cluster while you do your load tests (eg:  
> with our SPM[http://sematext.com/spm/elasticsearch-performance-monitoring/](http://sematext.com/spm/elasticsearch-performance-monitoring/)),  
> so you know what's limiting your performance.
> 
> On Thu, Jun 20, 2013 at 8:49 AM, Imdad Ahmed \<[imd...@gmail.com](mailto:imd...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > We are doing performance testing, to identify the right settings for  
> > facet search.  
> > The following are the data points. Can you help us identify settings that  
> > can improve the search response time?
> > 
> > # Context:
> > 
> > Query:  
> > {  
> > "facets": {  
> > "tag": {  
> > "terms": {  
> > "field": "category"  
> > }  
> > }  
> > },  
> > "fields": [  
> > "title"  
> > ]  
> > }
> > 
> > So this is basically a facet match all query, chosen to do load testing.  
> > Note that the field "category" is keyword analyzed
> > 
> > Data:  
> > Data setup was done using wikipedia river. Index size is 170GB
> > 
> > Setup:  
> > 3 nodes, each with 2 cores and 8GB RAM, 1 Zookeeper node, 3 shards (1  
> > shard on each node), no replica
> > 
> > Some existing cluster level settings:  
> > threadpool for search : fixed, 4 threads, 10000 queue size  
> > mlockall : true
> > 
> > JAVA\_OPTS from elasticsearch-env.sh  
> > ES\_JAVA\_OPTS="  
> > -server  
> > -Djava.net.preferIPv4Stack=true  
> > -Des.config=/usr/local/etc/elasticsearch/elasticsearch.yml  
> > -Xms2299m  
> > -Xmx2299m  
> > -Xss256k  
> > -XX:+UseParNewGC  
> > -XX:+UseConcMarkSweepGC  
> > -XX:CMSInitiatingOccupancyFraction=75  
> > -XX:+UseCMSInitiatingOccupancyOnly  
> > -XX:+HeapDumpOnOutOfMemoryError"
> > 
> > Current performance:  
> > Load is: 45 concurrent requests over 2 minutes duration  
> > Mean response time is: 23.2 seconds
> > 
> > Can you kindly suggest what other what other _elasticsearch settings_ may  
> > be tweaked to improve facet search performance.
> > 
> > --  
> > 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:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [June 21, 2013, 6:44am UTC](https://discuss.elastic.co/t/how-to-improve-facet-search-performance/12487/4 "2013-06-21T06:44:58Z")

</div>

Hi,

It works for me now, can you try again?

On Fri, Jun 21, 2013 at 9:40 AM, Imdad Ahmed [imdhmd@gmail.com](mailto:imdhmd@gmail.com) wrote:

> Looks like SPM registration is having a downtime. I'm unable to register:  
> [https://apps.sematext.com/users-web/register.do](https://apps.sematext.com/users-web/register.do)
> 
> On Thursday, June 20, 2013 2:22:45 PM UTC+5:30, Radu Gheorghe wrote:
> 
> > Hello,
> > 
> > What's the bottleneck? CPU, IO, ...?
> > 
> > It's a good idea to monitor your cluster while you do your load tests  
> > (eg: with our SPM[http://sematext.com/spm/elasticsearch-performance-monitoring/](http://sematext.com/spm/elasticsearch-performance-monitoring/)),  
> > so you know what's limiting your performance.
> > 
> > On Thu, Jun 20, 2013 at 8:49 AM, Imdad Ahmed [imd...@gmail.com](mailto:imd...@gmail.com) wrote:
> > 
> > > We are doing performance testing, to identify the right settings for  
> > > facet search.  
> > > The following are the data points. Can you help us identify settings  
> > > that can improve the search response time?
> > > 
> > > # Context:
> > > 
> > > Query:  
> > > {  
> > > "facets": {  
> > > "tag": {  
> > > "terms": {  
> > > "field": "category"  
> > > }  
> > > }  
> > > },  
> > > "fields": [  
> > > "title"  
> > > ]  
> > > }
> > > 
> > > So this is basically a facet match all query, chosen to do load testing.  
> > > Note that the field "category" is keyword analyzed
> > > 
> > > Data:  
> > > Data setup was done using wikipedia river. Index size is 170GB
> > > 
> > > Setup:  
> > > 3 nodes, each with 2 cores and 8GB RAM, 1 Zookeeper node, 3 shards (1  
> > > shard on each node), no replica
> > > 
> > > Some existing cluster level settings:  
> > > threadpool for search : fixed, 4 threads, 10000 queue size  
> > > mlockall : true
> > > 
> > > JAVA\_OPTS from elasticsearch-env.sh  
> > > ES\_JAVA\_OPTS="  
> > > -server  
> > > -Djava.net.preferIPv4Stack=\*\*true  
> > > -Des.config=/usr/local/etc/\*\*elasticsearch/elasticsearch.\*\*yml  
> > > -Xms2299m  
> > > -Xmx2299m  
> > > -Xss256k  
> > > -XX:+UseParNewGC  
> > > -XX:+UseConcMarkSweepGC  
> > > -XX: **CMSInitiatingOccupancyFraction** =75  
> > > -XX:+\*\*UseCMSInitiatingOccupancyOnly  
> > > -XX:+\*\*HeapDumpOnOutOfMemoryError"
> > > 
> > > Current performance:  
> > > Load is: 45 concurrent requests over 2 minutes duration  
> > > Mean response time is: 23.2 seconds
> > > 
> > > Can you kindly suggest what other what other _elasticsearch settings_  
> > > may be tweaked to improve facet search performance.
> > > 
> > > --  
> > > 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](http://googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > .
> > 
> > --  
> > [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:30am UTC](https://discuss.elastic.co/t/how-to-improve-facet-search-performance/12487/5 "2017-07-06T02:30:04Z")

</div>


