弹性搜索的性能问题

时间:2017-01-16 19:56:44

标签: amazon-web-services elasticsearch amazon-s3 elasticsearch-2.0

我正在尝试使用弹性搜索来聚合数据:我有以下格式的文档:

{
"userId" : "", 
"company": "foo" , 
"city"   : "fooCity",
"timeSpendonTask1InSec" : 5sec,
..............
"timeSpendonTask5InSec" : 10sec,
 "date" : "yyyy-mm-dd"
 }

我一天有大约800k这样的物品。我正在运行弹性搜索查询:

{
  "size": 0,
  "aggs": {
    "group_by_state": {
      "terms": {
        "field": "userId",
        "size": 25,
        "order": {
                "_count" : "desc" 
              }
      },
      "aggs": {
        "avg_sec": {
          "avg": {
            "field": "timeSpendonTask1InSec"
          }
        },
        "sum_seconds" :{
            "sum" : {
            "field": "timeSpendonTask5InSec"
            }
        }

      }
    }
  }
}

我有以下分片设置: 我每天都有单独的索引。

2 Replica
number_of_shards 10

我正在使用AWS托管的ELS以及以下服务器设置:

    Instance count: 20
    Instance type: i2.2xlarge.elasticsearch
    Dedicated master instance count: 5
    Dedicated master instance type: i2.2xlarge.elasticsearch
    Enable zone awareness : true

我尝试使用从5100的不同的2聚合桶大小对ELS进行基准测试。随着铲斗数量的增加,ELS性能下降。

但是,让我们关注桶数25.我只能使用上述数据实现100 RPS,进一步导致响应时间不佳。 使用100 RPS,AWS监控仪表板显示的CPU使用率介于75%到100%之间。

有关当前设置可能出错的任何建议吗?或者我是否将ElasticSearch用于错误的用例?

0 个答案:

没有答案