Skip to content

Heap Explosion on even small cardinality queries in ES 5.3.1 / Kibana 5.3.1 #24359

@jay-dihenkar

Description

@jay-dihenkar

Elasticsearch version: 5.3.1

Plugins installed: [only defaults]

JVM version: java version "1.8.0_112

OS version: centos 6.8 ( 2.6.32-642.6.2.el6.x86_64 )

Description of the problem including expected versus actual behavior:

When loading unique counts on a field of values having 417docs with 417 total records, ES is going OOM. On introducing the circuit breaker I could capture this in Kibana :

Visualize: [request] Data too large, data for [<reused_arrays>] would be [119719468000/111.4gb], which is larger than the limit of [8511422464/7.9gb] [request] Data too large, data for [<reused_arrays>] would be [138553307200/129gb], which is larger than the limit of [8511422464/7.9gb] [request] Data too large, data for [<reused_arrays>] would be [111728258400/104gb], which is larger than the limit of [8511422464/7.9gb] [request] Data too large, data for [<reused_arrays>] would be [117386429600/109.3gb], which is larger than the limit of [8511422464/7.9gb] [request] Data too large, data for [<reused_arrays>] would be [120568676800/112.2gb], which is larger than the limit of [8511422464/7.9gb] [request] Data too large, data for [<reused_arrays>] would be [108346902400/100.9gb], which is larger than the limit of [8511422464/7.9gb] [request] Data too large, data for [<reused_arrays>] would be [106682848800/99.3gb], which is larger than the limit of [8511422464/7.9gb] [request] Data too large, data for [<reused_arrays>] would be [136041769600/126.6gb], which is larger than the limit of [8511422464/7.9gb] [request] Data too large, data for [<reused_arrays>] would be [140788947200/131.1gb], which is larger than the limit of [8511422464/7.9gb]

For 417 Docs is this expected????!!!

  • Field is not analyzed
  • Docs are flat, no nesting

The query being hit for aggregation in debug log is :

[2017-04-27T02:36:36,042][DEBUG][o.e.a.s.TransportSearchAction] [i-vL8bl] [test-index][4], node[i-vL8blaT026-wCIWYo16g], [P], s[STARTED], a[id=bVc3KluLSg2mCrR3FRiENw]: Fail
ed to execute [SearchRequest{searchType=QUERY_THEN_FETCH, indices=[test-index], indicesOptions=IndicesOptions[id=39, ignore_unavailable=true, allow_no_indices=true, expand_
wildcards_open=true, expand_wildcards_closed=false, allow_alisases_to_multiple_indices=true, forbid_closed_indices=true], types=[], routing='null', preference='149327808
1183', requestCache=null, scroll=null, source={
  "size" : 0,
  "query" : {
    "bool" : {
      "must" : [
        {
          "query_string" : {
            "query" : "*",
            "fields" : [ ],
            "use_dis_max" : true,
            "tie_breaker" : 0.0,
            "default_operator" : "or",
            "auto_generate_phrase_queries" : false,
            "max_determinized_states" : 10000,
            "enable_position_increments" : true,
            "fuzziness" : "AUTO",
            "fuzzy_prefix_length" : 0,
            "fuzzy_max_expansions" : 50,
            "phrase_slop" : 0,
            "analyze_wildcard" : true,
            "escape" : false,
            "split_on_whitespace" : true,
            "boost" : 1.0
          }
        },
        {
          "range" : {
            "ES_timestamp" : {
              "from" : 1487183400000,
              "to" : 1487269800000,
              "include_lower" : true,
              "include_upper" : true,
              "format" : "epoch_millis",
              "boost" : 1.0
            }
          }
        }
      ],
      "disable_coord" : false,
      "adjust_pure_negative" : true,
      "boost" : 1.0
    }
  },
  "_source" : {
    "includes" : [ ],
    "excludes" : [ ]
  },
  "aggregations" : {
    "2" : {
      "terms" : {
        "field" : "<fieldname>",
        "size" : 5,
        "min_doc_count" : 1,
        "shard_min_doc_count" : 0,
        "show_term_doc_count_error" : false,
        "order" : [
          {
            "1" : "desc"
          },
          {
            "_term" : "asc"
          }
        ]
      },
      "aggregations" : {
        "1" : {
          "cardinality" : {
            "field" : "<fieldname>"
          }
        }
      }
    }
  }
}}]

Loading the same on precision value of {"precision_threshold": 1 } is working as expected but again fails for threshold of 10.

The mappings for the field are :

"<fieldname>": {
"type": "string",
"index": "not_analyzed",
"fielddata": false
},

PS: I have already gone through the following issues before creating this one to ensure it's not a duplicate!

Issues:
#21942
#19215

And on discuss forum:
https://discuss.elastic.co/t/mapping-change-on-upgrade-to-5-2-2/82622

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions