Elasticsearch响应时间 - 奇怪的值

时间:2016-11-02 17:34:17

标签: elasticsearch

我正在使用门牌号数据查询简单的Elasticsearch索引。

".house-numbers": {
    "mappings": {
      "house-number": {
        "properties": {
          "id": {
            "type": "keyword"
          },
          "value": {
            "type": "text",
            "index_options": "docs"
          }
        }
      }
    }
  }

然后我查询POST http request

等数据

请求网址

http://localhost:9200/.house-numbers/housenumber/_search

接头:

Content-Type: text/plain
Content-Length: 55
Accept: */*
Accept-Encoding: gzip, deflate, br

请求正文:

{
  "size": 30,
  "query": {
    "match": {
      "value": {
        "query": "2 3"
      }
    }
  }
}

请求在10ms - 30ms内返回数据,一切正常。 Elasticsearch响应参数在所有情况下都很小3-5ms。

当我将请求正文中的大小更改为"size": 35时,响应时间突然缩短为500毫秒。从Elasticsearch获取参数是一样的。没有特殊字符,响应的大小非常相似。

我尝试了许多客户NEST,Postman,Fiddler来做这些请求,每个客户都有相同的行为。

我的弹性搜索的设置仅包含

http.compression : true
http.compression_level : 9

设置我的jvm

"jvm": {
  "timestamp": 1478108615141,
  "uptime_in_millis": 17150141,
  "mem": {
    "heap_used_in_bytes": 1384307624,
    "heap_used_percent": 66,
    "heap_committed_in_bytes": 2077753344,
    "heap_max_in_bytes": 2077753344,
    "non_heap_used_in_bytes": 96403904,
    "non_heap_committed_in_bytes": 101502976,
    "pools": {
      "young": {
        "used_in_bytes": 324358632,
        "max_in_bytes": 558432256,
        "peak_used_in_bytes": 558432256,
        "peak_max_in_bytes": 558432256
      },
      "survivor": {
        "used_in_bytes": 69730304,
        "max_in_bytes": 69730304,
        "peak_used_in_bytes": 69730304,
        "peak_max_in_bytes": 69730304
      },
      "old": {
        "used_in_bytes": 990220848,
        "max_in_bytes": 1449590784,
        "peak_used_in_bytes": 1190046816,
        "peak_max_in_bytes": 1449590784
      }...

我尝试了不同版本的elasticsearch 我尝试了不同的设置 - 关闭http.compression,更改compression_level 我为弹性搜索尝试了另一个主机

我不知道是什么原因造成了这个问题,我无法继续工作。 知道在哪里看或如何进行?

1 个答案:

答案 0 :(得分:0)

当然问题不在于弹性搜索,而是在http通信中,特别是在打开http压缩时

提示删除延迟

  • close fiddler
  • 禁用防火墙和防病毒软件
  • 关闭所有可能拦截http通信的程序