# Elasticsearch not scaling beyond ~400 requests per second

**URL:** <https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032>\
**Category:** Elasticsearch\
**Created:** [October 27, 2015, 1:41am UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032 "2015-10-27T01:41:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_D\_Ament](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_d_ament/32/764_2.png) [@John\_D\_Ament](https://discuss.elastic.co/u/John_D_Ament)\
**Post date:** [October 27, 2015, 1:41am UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032/1 "2015-10-27T01:41:08Z")

</div>

Hi,

We have the following query. It doesn't seem to scale for us. Using the REST API, we're only able to perform to about 400 requests/second. It's a 3 node cluster, about 200k documents, 5 shards and 5gb of memory per node on ES 1.5.2. The query matches 45 of those documents. Neither CPU nor memory show any taxing, and we're currently using cached threadpool mode (though similar results come back with fixed sizing). We are seeing linear growth in the response times, starting from single digit milliseconds to 10ths of seconds.

Now I can see some explicit bad moves in the query, especially what seems like a duplicate term filter. I would image ES optimizes that but can't be sure.

```
POST myindex/_search
{
  "aggregations" : {
    "filter1" : {
      "filter" : {
        "and" : {
          "filters" : [ {
            "terms" : {
              "fromId" : [2,31]
            }
          }, {
            "term" : {
              "closed" : false
            }
          }, {
            "and" : {
              "filters" : [ {
                "terms" : {
                  "toId" : [2,31]
                }
              }, {
                "terms" : {
                  "fromId" : [2,31]
                }
              } ]
            }
          } ]
        }
      },
      "aggregations" : {
        "range" : {
          "range" : {
            "field" : "dueDateNumber",
            "ranges" : [ {
              "key" : "overdue",
              "to" : 201510260000
            }, {
              "key" : "comingsoon",
              "from" : 201510260000,
              "to" : 201511240000
            }, {
              "key" : "thefuture",
              "from" : 201511240000
            } ]
          }
        }
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![John\_D\_Ament](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_d_ament/32/764_2.png) [@John\_D\_Ament](https://discuss.elastic.co/u/John_D_Ament)\
**Post date:** [October 28, 2015, 3:00pm UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032/2 "2015-10-28T15:00:36Z")

</div>

It looks like regardless of the query used, we're maxing out at 400~ish connections.

---

<div class="post-metadata">

**Author:** ![John\_D\_Ament](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_d_ament/32/764_2.png) [@John\_D\_Ament](https://discuss.elastic.co/u/John_D_Ament)\
**Post date:** [November 10, 2015, 9:08pm UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032/3 "2015-11-10T21:08:36Z")

</div>

Just wondering if any community members have any thoughts about this?

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 10, 2015, 10:15pm UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032/4 "2015-11-10T22:15:18Z")

</div>

I have also ES 1.5.2 with 3 nodes in production. While using the transport client Java API I can send a mix of ~5000 term queries per second and ~15000 documents per second (bulk indexing) from a 4th server for ~3 hours (until job completes), and it's the 4th server that is limiting those numbers.

---

<div class="post-metadata">

**Author:** ![John\_D\_Ament](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_d_ament/32/764_2.png) [@John\_D\_Ament](https://discuss.elastic.co/u/John_D_Ament)\
**Post date:** [November 10, 2015, 11:01pm UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032/5 "2015-11-10T23:01:11Z")

</div>

Wow, I wish I was seeing that problem 😄  
Any chance you can share some of your tuning or configuration options? What OS do you use?

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 10, 2015, 11:33pm UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032/6 "2015-11-10T23:33:24Z")

</div>

The servers are HP DL165 G7, 32 cores, 64GB RAM, ~1.8TB RAID0, data dir mount with `noatime`

OS: RHEL 6.6

java version "1.8.0\_45"  
Java(TM) SE Runtime Environment (build 1.8.0\_45-b14)  
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

java -Xms16g -Xmx16g -XX:+UseG1GC -XX:MaxGCPauseMillis=1000 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy -XX:+PrintReferenceGC -XX:+ParallelRefProcEnabled ...

Current ES configuration: [https://gist.github.com/jprante/08b061171f4ee1876378](https://gist.github.com/jprante/08b061171f4ee1876378)

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [November 10, 2015, 11:52pm UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032/7 "2015-11-10T23:52:26Z")

</div>

Don't forget that the weight of the query is also very important. If you  
are executing long queries, perhaps with aggregations, you will obviously  
see a reduced number of queries per second. The query thread pool is finite  
after all.

Ivan

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 10, 2015, 11:56pm UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032/8 "2015-11-10T23:56:42Z")

</div>

Yes. I find 400 aggregations per second an extremely good rate.

---

<div class="post-metadata">

**Author:** ![John\_D\_Ament](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_d_ament/32/764_2.png) [@John\_D\_Ament](https://discuss.elastic.co/u/John_D_Ament)\
**Post date:** [November 11, 2015, 12:23am UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032/9 "2015-11-11T00:23:54Z")

</div>

Yes, but even when we're not using aggregations we're seeing this issue.

---

<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:39pm UTC](https://discuss.elastic.co/t/elasticsearch-not-scaling-beyond-400-requests-per-second/33032/10 "2017-07-05T23:39:22Z")

</div>


