Named query performance degradation after upgrading to 8.13.2 (from 8.7.1)

Hello,

After upgrading from 8.7.1 to 8.13.2, some of our queries are about 2x slower (longer response time). After digging, I've identified that the named query is causing the problem. Queries with "_name" get about 2x slower, while the performance of queries without "_name" stays the same.

We are running ES on K8S using ECK but it can be reproducible with docker environments. The same query takes longer in 8.13.2.

8.7.1:

--- 1st RUN ---
{
  "took" : 59,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  }
}
--- 2nd RUN ---
{
  "took" : 13,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  }
}
--- 3rd RUN ---
{
  "took" : 13,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  }
}

8.13.2:

--- 1st RUN ---
{
  "took" : 296,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  }
}
--- 2nd RUN ---
{
  "took" : 200,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  }
}
--- 3rd RUN ---
{
  "took" : 201,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  }
}

I've uploaded a reproducible set to my GitHub repos so that ES team can confirm it.

1 Like

Not 2x but more than 5x.

Thanks for the detailed script. I think you should open an issue in GitHub - elastic/elasticsearch: Free and Open, Distributed, RESTful Search Engine with the same details you shared.

Thanks. I opened an issue.

1 Like