2017-02-08 4 views
0

Примечание: Это перекрестно размещено на форуме elasticsearch (https://discuss.elastic.co/t/store-size-1-000-times-the-document-byte-size/74258/4).Размер магазина Elasticsearch в 1000 раз превышает размер байта документа

У меня наблюдается примерно 1,000-кратное увеличение в store.size по размеру байта документа. У меня очень простое сопоставление с очень маленькими документами (менее 1 килобайта), и я сопоставил свое сопоставление с внутренним сопоставлением Elasticsearch, и они одинаковы, поэтому нет никакого отображения динамического отображения.

До сих пор я проглотил 60 437 документов и имел размер store.size 19.6Gb (в среднем 300 кбайт на документ), но средний размер байта (длина строки String.getBytes()) JSON составляет 300-400 байт на документ. В другом прогоне документы составляли в среднем около 1 МБ - 3 МБ на документ.

Я использую Elasticsearch 5.2 на экземпляре M4.2xlarge EC2. Elasticsearch был установлен с главным образом всеми значениями по умолчанию, за исключением того, что мне нужно было сделать для того, чтобы передать проверки boostrap и привязать к нелокальному IP. Я выделил 16 ГБ (половина моей физической памяти) для Elasticsearch.

Я использовал для запуска Elasticsearch 2.x и глотал FAR больше полей и гораздо больших документов, чем только эти несколько полей, и имел только около 20 к/документ, который был по-прежнему существенным, хотя и управляемым.

Если кто-нибудь может указать на что-нибудь, что бы исправить это, я был бы признателен. Или есть ли конфигурация ES 5.x, которую я не видел, это разрешит это?

Ниже приведено мое сопоставление.

{ 
    "settings": { 
     "index.query.default_field": "tweetText" 
    }, 
    "mappings": { 
     "tweet": { 
      "_all": { 
       "enabled": false 
      }, 
      "properties": { 
       "tweetDate": { 
        "type": "date", 
        "format": "EEE MMM dd HH:mm:ss Z YYYY||strict_date_optional_time||epoch_millis" 
       }, 
       "userId": { 
        "type": "text", 
        "index": "not_analyzed" 
       }, 
       "screenName": { 
        "type": "text", 
        "index": "not_analyzed" 
       }, 
       "tweetText": { 
        "type": "text" 
       }, 
       "cleanedText": { 
        "type": "text" 
       }, 
       "tweetId": { 
        "type": "text", 
        "index": "not_analyzed" 
       }, 
       "location": { 
        "type": "geo_point", 
        "ignore_malformed": true 
       }, 
       "placeName": { 
        "type": "keyword", 
        "doc_values": true, 
        "eager_global_ordinals": false 
       }, 
       "placeCountry": { 
        "type": "keyword", 
        "doc_values": true, 
        "eager_global_ordinals": true 
       }, 
       "placeCountryCode": { 
        "type": "keyword", 
        "doc_values": false, 
        "eager_global_ordinals": false, 
        "index": false 
       }, 
       "placeBoundingBox": { 
        "type": "geo_shape", 
        "tree": "quadtree", 
        "precision": "1m" 
       }, 
       "resolvedUrls": { 
        "type": "text", 
        "index": "not_analyzed" 
       }, 
       "hashtags": { 
        "type": "text" 
       }, 
       "mentions": { 
        "type": "text" 
       }, 
       "geoInferences": { 
        "properties": { 
         "matchedName": { 
          "type": "text" 
         }, 
         "asciiName": { 
          "type": "keyword", 
          "doc_values": true, 
          "eager_global_ordinals": false 
         }, 
         "country": { 
          "type": "keyword", 
          "doc_values": true, 
          "eager_global_ordinals": true 
         }, 
         "county": { 
          "type": "text" 
         }, 
         "countryCode": { 
          "type": "keyword", 
          "doc_values": false, 
          "eager_global_ordinals": false, 
          "index": false 
         }, 
         "city": { 
          "type": "text" 
         }, 
         "admin1Code": { 
          "type": "keyword", 
          "doc_values": false, 
          "eager_global_ordinals": false, 
          "index": false 
         }, 
         "admin2Code": { 
          "type": "keyword", 
          "doc_values": false, 
          "eager_global_ordinals": false, 
          "index": false 
         }, 
         "admin3Code": { 
          "type": "keyword", 
          "doc_values": false, 
          "eager_global_ordinals": false, 
          "index": false 
         }, 
         "admin4Code": { 
          "type": "keyword", 
          "doc_values": false, 
          "eager_global_ordinals": false, 
          "index": false 
         }, 
         "confidence": { 
          "type": "float", 
          "doc_values": false, 
          "ignore_malformed": false, 
          "index": false 
         }, 
         "coordinates": { 
          "type": "geo_point", 
          "ignore_malformed": true 
         } 
        } 
       }, 
       "temporalInferences": { 
        "type": "date", 
        "ignore_malformed": true 
       } 
      } 
     } 
    } 
} 

документ образца:

{ 
    "_index": "twitter", 
    "_type": "tweet", 
    "_id": "AVoZivLca9LOhnR10_ll", 
    "_score": null, 
    "_source": { 
    "tweetDate": 1486487211000, 
    "userId": "123456789", 
    "screenName": "removed", 
    "tweetText": "RT @wef: America’s dominance is over. By 2030, we'll have a handful of global powers https://www.weforum.org/agenda/2016/11/america-s-dominance-is-over/?utm_content=buffer73cd5&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer #wef17 https://twitter.com/wef/status/828994745200435200/photo/1", 
    "cleanedText": "RT @wef: America s dominance is over. By 2030, we'll have a handful of global powers https://www.weforum.org/agenda/2016/11/america-s-dominance-is-over/?utm_content=buffer73cd5&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer #wef17 https://twitter.com/wef/status/828994745200435200/photo/1", 
    "tweetId": "829013568288796672", 
    "resolvedUrls": [ 
     "https://www.weforum.org/agenda/2016/11/america-s-dominance-is-over/?utm_content=buffer73cd5&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer" 
    ], 
    "hashtags": [ 
     "wef17" 
    ], 
    "mentions": [ 
     "wef" 
    ], 
    "geoInferences": [ 
     { 
     "matchedName": "America", 
     "asciiName": "United States", 
     "country": "United States", 
     "countryCode": "US", 
     "coordinates": [ 
      -98.5, 
      39.76 
     ], 
     "admin1Code": "00", 
     "admin2Code": "", 
     "admin3Code": "", 
     "admin4Code": "", 
     "confidence": 1 
     } 
    ], 
    "temporalInferences": [ 
     1893474000000 
    ] 
    }, 
    "fields": { 
    "temporalInferences": [ 
     1893474000000 
    ], 
    "tweetDate": [ 
     1486487211000 
    ] 
    }, 
    "sort": [ 
    1486487211000 
    ] 
} 

Выход

GET /_cat/indices/twitter?pri&v&h=health,index,pri,rep,docs.count,mt,pri,rep,docs.count,store.size,pri.store.size 

health | index | pri | rep | docs.count | mt | pri.mt | store.size | pri.store.size | pri.store.size 
yellow | twitter | 5 | 1 | 26860 | 74 | 74 | 10.1gb | 10.1gb | 10.1gb 

Выход:

GET /twitter/_stats 

{ 
    "_shards": { 
    "total": 10, 
    "successful": 5, 
    "failed": 0 
    }, 
    "_all": { 
    "primaries": { 
     "docs": { 
     "count": 26860, 
     "deleted": 0 
     }, 
     "store": { 
     "size_in_bytes": 11027965678, 
     "throttle_time_in_millis": 0 
     }, 
     "indexing": { 
     "index_total": 27397, 
     "index_time_in_millis": 3568991, 
     "index_current": 1, 
     "index_failed": 0, 
     "delete_total": 0, 
     "delete_time_in_millis": 0, 
     "delete_current": 0, 
     "noop_update_total": 0, 
     "is_throttled": false, 
     "throttle_time_in_millis": 195961 
     }, 
     "get": { 
     "total": 0, 
     "time_in_millis": 0, 
     "exists_total": 0, 
     "exists_time_in_millis": 0, 
     "missing_total": 0, 
     "missing_time_in_millis": 0, 
     "current": 0 
     }, 
     "search": { 
     "open_contexts": 0, 
     "query_total": 55, 
     "query_time_in_millis": 294, 
     "query_current": 0, 
     "fetch_total": 36, 
     "fetch_time_in_millis": 3209, 
     "fetch_current": 0, 
     "scroll_total": 0, 
     "scroll_time_in_millis": 0, 
     "scroll_current": 0, 
     "suggest_total": 0, 
     "suggest_time_in_millis": 0, 
     "suggest_current": 0 
     }, 
     "merges": { 
     "current": 0, 
     "current_docs": 0, 
     "current_size_in_bytes": 0, 
     "total": 76, 
     "total_time_in_millis": 350987, 
     "total_docs": 45409, 
     "total_size_in_bytes": 4027595474, 
     "total_stopped_time_in_millis": 0, 
     "total_throttled_time_in_millis": 48633, 
     "total_auto_throttle_in_bytes": 82233108 
     }, 
     "refresh": { 
     "total": 857, 
     "total_time_in_millis": 2994887, 
     "listeners": 0 
     }, 
     "flush": { 
     "total": 15, 
     "total_time_in_millis": 291939 
     }, 
     "warmer": { 
     "current": 0, 
     "total": 876, 
     "total_time_in_millis": 534 
     }, 
     "query_cache": { 
     "memory_size_in_bytes": 0, 
     "total_count": 0, 
     "hit_count": 0, 
     "miss_count": 0, 
     "cache_size": 0, 
     "cache_count": 0, 
     "evictions": 0 
     }, 
     "fielddata": { 
     "memory_size_in_bytes": 24808, 
     "evictions": 0 
     }, 
     "completion": { 
     "size_in_bytes": 0 
     }, 
     "segments": { 
     "count": 139, 
     "memory_in_bytes": 186032131, 
     "terms_memory_in_bytes": 185758725, 
     "stored_fields_memory_in_bytes": 43976, 
     "term_vectors_memory_in_bytes": 0, 
     "norms_memory_in_bytes": 77888, 
     "points_memory_in_bytes": 714, 
     "doc_values_memory_in_bytes": 150828, 
     "index_writer_memory_in_bytes": 1316180948, 
     "version_map_memory_in_bytes": 42250, 
     "fixed_bit_set_memory_in_bytes": 0, 
     "max_unsafe_auto_id_timestamp": -1, 
     "file_sizes": { 

     } 
     }, 
     "translog": { 
     "operations": 11997, 
     "size_in_bytes": 5555179 
     }, 
     "request_cache": { 
     "memory_size_in_bytes": 0, 
     "evictions": 0, 
     "hit_count": 195, 
     "miss_count": 195 
     }, 
     "recovery": { 
     "current_as_source": 0, 
     "current_as_target": 0, 
     "throttle_time_in_millis": 0 
     } 
    }, 
    "total": { 
     "docs": { 
     "count": 26860, 
     "deleted": 0 
     }, 
     "store": { 
     "size_in_bytes": 11027965678, 
     "throttle_time_in_millis": 0 
     }, 
     "indexing": { 
     "index_total": 27397, 
     "index_time_in_millis": 3568991, 
     "index_current": 1, 
     "index_failed": 0, 
     "delete_total": 0, 
     "delete_time_in_millis": 0, 
     "delete_current": 0, 
     "noop_update_total": 0, 
     "is_throttled": false, 
     "throttle_time_in_millis": 195961 
     }, 
     "get": { 
     "total": 0, 
     "time_in_millis": 0, 
     "exists_total": 0, 
     "exists_time_in_millis": 0, 
     "missing_total": 0, 
     "missing_time_in_millis": 0, 
     "current": 0 
     }, 
     "search": { 
     "open_contexts": 0, 
     "query_total": 55, 
     "query_time_in_millis": 294, 
     "query_current": 0, 
     "fetch_total": 36, 
     "fetch_time_in_millis": 3209, 
     "fetch_current": 0, 
     "scroll_total": 0, 
     "scroll_time_in_millis": 0, 
     "scroll_current": 0, 
     "suggest_total": 0, 
     "suggest_time_in_millis": 0, 
     "suggest_current": 0 
     }, 
     "merges": { 
     "current": 0, 
     "current_docs": 0, 
     "current_size_in_bytes": 0, 
     "total": 76, 
     "total_time_in_millis": 350987, 
     "total_docs": 45409, 
     "total_size_in_bytes": 4027595474, 
     "total_stopped_time_in_millis": 0, 
     "total_throttled_time_in_millis": 48633, 
     "total_auto_throttle_in_bytes": 82233108 
     }, 
     "refresh": { 
     "total": 857, 
     "total_time_in_millis": 2994887, 
     "listeners": 0 
     }, 
     "flush": { 
     "total": 15, 
     "total_time_in_millis": 291939 
     }, 
     "warmer": { 
     "current": 0, 
     "total": 876, 
     "total_time_in_millis": 534 
     }, 
     "query_cache": { 
     "memory_size_in_bytes": 0, 
     "total_count": 0, 
     "hit_count": 0, 
     "miss_count": 0, 
     "cache_size": 0, 
     "cache_count": 0, 
     "evictions": 0 
     }, 
     "fielddata": { 
     "memory_size_in_bytes": 24808, 
     "evictions": 0 
     }, 
     "completion": { 
     "size_in_bytes": 0 
     }, 
     "segments": { 
     "count": 139, 
     "memory_in_bytes": 186032131, 
     "terms_memory_in_bytes": 185758725, 
     "stored_fields_memory_in_bytes": 43976, 
     "term_vectors_memory_in_bytes": 0, 
     "norms_memory_in_bytes": 77888, 
     "points_memory_in_bytes": 714, 
     "doc_values_memory_in_bytes": 150828, 
     "index_writer_memory_in_bytes": 1316180948, 
     "version_map_memory_in_bytes": 42250, 
     "fixed_bit_set_memory_in_bytes": 0, 
     "max_unsafe_auto_id_timestamp": -1, 
     "file_sizes": { 

     } 
     }, 
     "translog": { 
     "operations": 11997, 
     "size_in_bytes": 5555179 
     }, 
     "request_cache": { 
     "memory_size_in_bytes": 0, 
     "evictions": 0, 
     "hit_count": 195, 
     "miss_count": 195 
     }, 
     "recovery": { 
     "current_as_source": 0, 
     "current_as_target": 0, 
     "throttle_time_in_millis": 0 
     } 
    } 
    }, 
    "indices": { 
    "twitter": { 
     "primaries": { 
     "docs": { 
      "count": 26860, 
      "deleted": 0 
     }, 
     "store": { 
      "size_in_bytes": 11027965678, 
      "throttle_time_in_millis": 0 
     }, 
     "indexing": { 
      "index_total": 27397, 
      "index_time_in_millis": 3568991, 
      "index_current": 1, 
      "index_failed": 0, 
      "delete_total": 0, 
      "delete_time_in_millis": 0, 
      "delete_current": 0, 
      "noop_update_total": 0, 
      "is_throttled": false, 
      "throttle_time_in_millis": 195961 
     }, 
     "get": { 
      "total": 0, 
      "time_in_millis": 0, 
      "exists_total": 0, 
      "exists_time_in_millis": 0, 
      "missing_total": 0, 
      "missing_time_in_millis": 0, 
      "current": 0 
     }, 
     "search": { 
      "open_contexts": 0, 
      "query_total": 55, 
      "query_time_in_millis": 294, 
      "query_current": 0, 
      "fetch_total": 36, 
      "fetch_time_in_millis": 3209, 
      "fetch_current": 0, 
      "scroll_total": 0, 
      "scroll_time_in_millis": 0, 
      "scroll_current": 0, 
      "suggest_total": 0, 
      "suggest_time_in_millis": 0, 
      "suggest_current": 0 
     }, 
     "merges": { 
      "current": 0, 
      "current_docs": 0, 
      "current_size_in_bytes": 0, 
      "total": 76, 
      "total_time_in_millis": 350987, 
      "total_docs": 45409, 
      "total_size_in_bytes": 4027595474, 
      "total_stopped_time_in_millis": 0, 
      "total_throttled_time_in_millis": 48633, 
      "total_auto_throttle_in_bytes": 82233108 
     }, 
     "refresh": { 
      "total": 857, 
      "total_time_in_millis": 2994887, 
      "listeners": 0 
     }, 
     "flush": { 
      "total": 15, 
      "total_time_in_millis": 291939 
     }, 
     "warmer": { 
      "current": 0, 
      "total": 876, 
      "total_time_in_millis": 534 
     }, 
     "query_cache": { 
      "memory_size_in_bytes": 0, 
      "total_count": 0, 
      "hit_count": 0, 
      "miss_count": 0, 
      "cache_size": 0, 
      "cache_count": 0, 
      "evictions": 0 
     }, 
     "fielddata": { 
      "memory_size_in_bytes": 24808, 
      "evictions": 0 
     }, 
     "completion": { 
      "size_in_bytes": 0 
     }, 
     "segments": { 
      "count": 139, 
      "memory_in_bytes": 186032131, 
      "terms_memory_in_bytes": 185758725, 
      "stored_fields_memory_in_bytes": 43976, 
      "term_vectors_memory_in_bytes": 0, 
      "norms_memory_in_bytes": 77888, 
      "points_memory_in_bytes": 714, 
      "doc_values_memory_in_bytes": 150828, 
      "index_writer_memory_in_bytes": 1316180948, 
      "version_map_memory_in_bytes": 42250, 
      "fixed_bit_set_memory_in_bytes": 0, 
      "max_unsafe_auto_id_timestamp": -1, 
      "file_sizes": { 

      } 
     }, 
     "translog": { 
      "operations": 11997, 
      "size_in_bytes": 5555179 
     }, 
     "request_cache": { 
      "memory_size_in_bytes": 0, 
      "evictions": 0, 
      "hit_count": 195, 
      "miss_count": 195 
     }, 
     "recovery": { 
      "current_as_source": 0, 
      "current_as_target": 0, 
      "throttle_time_in_millis": 0 
     } 
     }, 
     "total": { 
     "docs": { 
      "count": 26860, 
      "deleted": 0 
     }, 
     "store": { 
      "size_in_bytes": 11027965678, 
      "throttle_time_in_millis": 0 
     }, 
     "indexing": { 
      "index_total": 27397, 
      "index_time_in_millis": 3568991, 
      "index_current": 1, 
      "index_failed": 0, 
      "delete_total": 0, 
      "delete_time_in_millis": 0, 
      "delete_current": 0, 
      "noop_update_total": 0, 
      "is_throttled": false, 
      "throttle_time_in_millis": 195961 
     }, 
     "get": { 
      "total": 0, 
      "time_in_millis": 0, 
      "exists_total": 0, 
      "exists_time_in_millis": 0, 
      "missing_total": 0, 
      "missing_time_in_millis": 0, 
      "current": 0 
     }, 
     "search": { 
      "open_contexts": 0, 
      "query_total": 55, 
      "query_time_in_millis": 294, 
      "query_current": 0, 
      "fetch_total": 36, 
      "fetch_time_in_millis": 3209, 
      "fetch_current": 0, 
      "scroll_total": 0, 
      "scroll_time_in_millis": 0, 
      "scroll_current": 0, 
      "suggest_total": 0, 
      "suggest_time_in_millis": 0, 
      "suggest_current": 0 
     }, 
     "merges": { 
      "current": 0, 
      "current_docs": 0, 
      "current_size_in_bytes": 0, 
      "total": 76, 
      "total_time_in_millis": 350987, 
      "total_docs": 45409, 
      "total_size_in_bytes": 4027595474, 
      "total_stopped_time_in_millis": 0, 
      "total_throttled_time_in_millis": 48633, 
      "total_auto_throttle_in_bytes": 82233108 
     }, 
     "refresh": { 
      "total": 857, 
      "total_time_in_millis": 2994887, 
      "listeners": 0 
     }, 
     "flush": { 
      "total": 15, 
      "total_time_in_millis": 291939 
     }, 
     "warmer": { 
      "current": 0, 
      "total": 876, 
      "total_time_in_millis": 534 
     }, 
     "query_cache": { 
      "memory_size_in_bytes": 0, 
      "total_count": 0, 
      "hit_count": 0, 
      "miss_count": 0, 
      "cache_size": 0, 
      "cache_count": 0, 
      "evictions": 0 
     }, 
     "fielddata": { 
      "memory_size_in_bytes": 24808, 
      "evictions": 0 
     }, 
     "completion": { 
      "size_in_bytes": 0 
     }, 
     "segments": { 
      "count": 139, 
      "memory_in_bytes": 186032131, 
      "terms_memory_in_bytes": 185758725, 
      "stored_fields_memory_in_bytes": 43976, 
      "term_vectors_memory_in_bytes": 0, 
      "norms_memory_in_bytes": 77888, 
      "points_memory_in_bytes": 714, 
      "doc_values_memory_in_bytes": 150828, 
      "index_writer_memory_in_bytes": 1316180948, 
      "version_map_memory_in_bytes": 42250, 
      "fixed_bit_set_memory_in_bytes": 0, 
      "max_unsafe_auto_id_timestamp": -1, 
      "file_sizes": { 

      } 
     }, 
     "translog": { 
      "operations": 11997, 
      "size_in_bytes": 5555179 
     }, 
     "request_cache": { 
      "memory_size_in_bytes": 0, 
      "evictions": 0, 
      "hit_count": 195, 
      "miss_count": 195 
     }, 
     "recovery": { 
      "current_as_source": 0, 
      "current_as_target": 0, 
      "throttle_time_in_millis": 0 
     } 
     } 
    } 
    } 
} 

РЕДАКТИРОВАТЬ 1 Я нашел источник этой проблемы. Кажется, что это ограниченная коробка, которая виновата, хотя я понятия не имею, почему.

Как только я удаляю ограничительную рамку из данных, поступающих в систему, индекс имеет нормальный размер (600 документов -> 550 кб), но как только я добавляю ограничительную рамку обратно (с новым индексом) размер скачков (3,593 документа -> 1,6 ГБ) с 84 документами, содержащими ограничительную рамку.

Ниже JSON ограничительной рамки:

"placeBoundingBox": { 
    "type": "polygon", 
    "coordinates": [ 
     [ 
     [ 
      -71.191421, 
      42.227797 
     ], 
     [ 
      -71.191421, 
      42.399542 
     ], 
     [ 
      -70.986004, 
      42.399542 
     ], 
     [ 
      -70.986004, 
      42.227797 
     ], 
     [ 
      -71.191421, 
      42.227797 
     ] 
     ] 
    ] 
    } 

отображение, связанное с кадрирования (от вызова GET/ИМЯ_ИНДЕКСА):

"placeBoundingBox": { 
    "type": "geo_shape", 
    "tree": "quadtree", 
    "precision": "1.0m" 
    } 

показать, что отображение делает Infact работу и создает правильный geo_shape (хотя Kibana не признает его как geo_shape), я выполнил следующий запрос и получил успешный хит:

GET /_search 
{ 
    "query": { 
    "bool": { 
     "must": { 
     "match_all": { 

     } 
     }, 
     "filter": { 
     "geo_shape": { 
      "placeBoundingBox": { 
      "shape": { 
       "type": "polygon", 
       "coordinates": [ 
       [ 
        [ 
        -71.191421, 
        42.227797 
        ], 
        [ 
        -71.191421, 
        42.399542 
        ], 
        [ 
        -70.986004, 
        42.399542 
        ], 
        [ 
        -70.986004, 
        42.227797 
        ], 
        [ 
        -71.191421, 
        42.227797 
        ] 
       ] 
       ] 
      }, 
      "relation": "within" 
      } 
     } 
     } 
    } 
    } 
} 

Я хотел бы иметь ограничительную рамку, есть ли что-то не так, как с картографированием, так и с данными? Является ли 1,0 м слишком мелкозернистым?

+0

некоторые вопросы, как насчет осколков/реплик для предыдущего варианта использования? потому что теперь у вас есть 5 осколков и 5 реплик (если я не ошибаюсь), может быть, это причина того, что вы видите размер как большую цифру. – Mysterion

+0

Я добавил поле реплики к отображению и установил его в 1 и без изменений. – Brooks

+0

Вы могли бы установить его в 0? изменит ли размер? – Mysterion

ответ

0

Проблема заключалась в точности отображения, которая была просто опечаткой (наш индекс для Elasticsearch 2.x имел точность 1 км). Одно крошечное письмо имело разницу ...

Точность 1 метра (1 м) создает чрезвычайно раздутый индекс.

Извлечение поля «точность» из сопоставления по умолчанию будет равно 50 м и индексу размера.

Смежные вопросы