Hi,
I've been testing concurrent search queries using JMeter.
I have an index with two types: commenttab contains around 725k
documents, hierarchy contains just 2600 documents. I run faceted and
straight queries. The faceted queries run against commenttab and use
the terms_stats facet to return mean values of question scores for
different values of a key field. e.g.,
curl -XGET localhost:9200/summary/commenttab/_search -d
{
"size": 0,
"query": {
"matchAll": {}
},
"facets": {
"week-sat": {
"terms_stats": {
"size": 0,
"key_field": "week",
"value_script":
"(doc['question2'].doubleValue + doc['question3'].doubleValue)/2"
}
},
"week-nps": {
"terms_stats": {
"size": 0,
"key_field": "week",
"value_field": "question1"
}
}
}
}
The straight query just fetches a page of documents from commenttab,
but does include a sort. e.g.
curl -XGET localhost:9200/summary/commenttab/_search -d'
{
"from": 0,
"size": 25,
"sort": [
{
"message_time": "desc"
}
],
"fields": [
"message_time",
"message_text",
"store",
"rdm",
"rod",
"question1",
"question2",
"question3",
"cat1",
"cat2"
],
"query": {
"matchAll": { }
}
}
I have two nodes. The index is split into 5 shards and there is 1
replica.
My problem is that when I have more than about 10 threads running in
JMeter, the response time for each of these queries shoots up from
less than 100ms to anything up to greater than 1.5 minutes (1000
threads).
The master node has 4 cores and 8GB. I set ES_MIN_MEM/ES_MAX_MEM to
4GB. The slave node has only 1 core and 1GB. I ran top on the two node
servers. The master is running with about 50% CPU assigned to ES. The
slave is running with 99%+.
For comparison, I ran an unsorted query against my commenttab and
hierarchy datasets. For 1000 threads, the response time on the small
hierarchy dataset stayed at less than 100ms; the response time on the
large commenttab dataset was 11s and the slave CPU went up to 99%.
curl -XGET localhost:9200/summary/commenttab/_search -d'
{
"size": 20,
"query": {
"matchAll": {}
}
}
I'm planning to try the following but do you have any other pointers
as to what I should be looking at?
- increasing the number of nodes by adding another 4 core server
- increasing the number of replicas
- run optimize on the index
Thanks for a great product!
Hugh