2017-02-10 19 views
0

對不起,如果我的問題是微不足道的,因爲我不熟悉ES。POST _cache/clear上真的發生了什麼?

我應該如何解釋query_cache的值如果我在stats之間調用clear cache

// GET _cluster/stats 
{ 
    ... 
    "indices": { 
     ... 
     "query_cache": { 
      "memory_size_in_bytes": 229449664, 
      "total_count": 19146885372L 
      "hit_count": 18430071, 
      "miss_count": 19128455301L, 
      "cache_size": 4101, 
      "cache_count": 126089, 
      "evictions": 121988 
     } 
    ... 
    } 
    ... 
} 

// POST _cache/clear 

// GET _cluster/stats 
{ 
    ... 
    "indices": { 
     ... 
     "query_cache": { 
      "memory_size_in_bytes": 0, 
      "total_count": 19146885372L 
      "hit_count": 18430071, 
      "miss_count": 19128455301L, 
      "cache_size": 0, 
      "cache_count": 126089, 
      "evictions": 121988 
     } 
    ... 
    } 
    ... 
} 

正如你可以看到memory_size_in_bytescache_size已經歸零。那是什麼意思?爲什麼cache_count尚未更改?

回答

2

這裏是針對每個值的簡短說明:

  • memory_size_in_bytes是記憶通過查詢在緩存
  • total_count佔用量在高速緩存查找的總數量(= hit_count + miss_count
  • hit_count是高速緩衝存儲器的總數目HIT
  • miss_count是高速緩衝存儲器的總數目MISS
  • cache_size是當前在高速緩存的查詢的總數
  • cache_count是高速緩存查找的總數迄今(= cache_size + evictions
  • evictions是已經從緩存
  • 逐出的查詢的總數

所以當你清除緩存時,你唯一能夠清楚的是內存(即memory_size_in_bytes)和緩存查詢的數量(即cache_size)。清除其他值是沒有意義的,因爲它們只是計數器。

+0

非常感謝 –