2016-03-11 14 views
-1

「hosts」和「Negative entries」統計信息位於「hosts cache」部分下的nscd -g命令中。從nscd.conf手冊中,我看到「肯定條目是指定緩存中的成功查詢」和「指定緩存中的否定條目(失敗查詢)」。 但是,當查詢本身意味着它無法在緩存中找到值時,緩存中的不成功查詢(否定條目)如何能夠命中(緩存匹配否定條目)......無法理解這兩者之間的區別.. 有些人可以簡單地解釋他們嗎?什麼是FreeCDA NSCD(命名服務Cache Deamon)中的「Positive entries」和「Negative entries」

{}代碼

  "hosts cache: 
      yes cache is enabled 
      yes cache is persistent 
      yes cache is shared 
      211 suggested size 
     216064 total data pool size 
     12880 used data pool size 
     3600 seconds time to live for positive entries 
      20 seconds time to live for negative entries 
     102658 cache hits on positive entries 
      221 cache hits on negative entries 
     129187 cache misses on positive entries 
     10926 cache misses on negative entries 
      42% cache hit rate 
      74 current number of cached values 
      167 maximum number of cached values 
      8 maximum chain length searched 
      0 number of delays on rdlock 
      0 number of delays on wrlock 
      0 memory allocations failed 
      yes check /etc/hosts for changes" 

{}代碼

回答

0

NSCD無關與FreeIPA。

積極的緩存條目是被發現存在的並且可以被更長時間緩存的條目,因爲假定它們不會經常改變。

負面的緩存條目是由於某種原因被發現不存在於源處的緩存條目,並且這個事實被緩存了更短的時間。消極緩存的原因是爲了避免源代碼的過度負載,因爲這可能比積極緩存的條目花費更多的時間和精力。例如,由於操作超時,可能會得到否定緩存條目。在短時間內重複相同請求會導致每個操作超時。負緩存允許通過高速緩存TTL迴應這些緩存請求(結果將是'條目不存在'),但是一旦TTL過期以用於負緩存條目,則再次重試以從原始源檢索數據。

相關問題