Memcached参数检查

时间:2012-04-16 01:51:04

标签: memcached

由于某种原因,目前memcache导致网站响应时间激增。

in other questions with memcached numbers cmd_get = get_hits + get_misses

STAT cmd_get 6236962
STAT get_hits 6236962
STAT get_misses 6543342

由于某种原因,在我们的设置中,cmd_get等于get_hits,get_misses大于cmd_get。当我尝试运行stats malloc时,我得到一个看起来很奇怪的错误。

结果是非常慢的转换,可能需要30秒才能执行memcache set并获得

问题#

  1. 为什么我的cmd_get = get_hits?
  2. 为什么我的get_misses高于我的cmd_get?
  3. 如何调试导致响应时间高峰的原因?
  4. stats

    STAT pid 18998
    STAT uptime 10603
    STAT time 1334538670
    STAT version 1.4.2
    STAT pointer_size 64
    STAT rusage_user 225.370000
    STAT rusage_system 717.590000
    STAT curr_connections 613
    STAT total_connections 1884098
    STAT connection_structures 1306
    STAT cmd_get 6236962
    STAT cmd_set 2517801
    STAT cmd_flush 0
    STAT get_hits 6236962
    STAT get_misses 6543342
    STAT delete_misses 234263
    STAT delete_hits 247387
    STAT incr_misses 0
    STAT incr_hits 0
    STAT decr_misses 0
    STAT decr_hits 0
    STAT cas_misses 0
    STAT cas_hits 0
    STAT cas_badval 0
    STAT bytes_read 6593604547
    STAT bytes_written 3999518494
    STAT limit_maxbytes 6442450944
    STAT accepting_conns 1
    STAT listen_disabled_num 0
    STAT threads 4
    STAT conn_yields 0
    STAT bytes 1417582141
    STAT curr_items 549532
    STAT total_items 2517801
    STAT evictions 0
    

    stats slab

    .........
    STAT 25:chunk_size 21696
    STAT 25:chunks_per_page 48
    STAT 25:total_pages 33
    STAT 25:total_chunks 1584
    STAT 25:used_chunks 1570
    STAT 25:free_chunks 0
    STAT 25:free_chunks_end 14
    STAT 25:mem_requested 30429185
    STAT 25:get_hits 1265
    STAT 25:cmd_set 3844
    STAT 25:delete_hits 0
    STAT 25:incr_hits 0
    STAT 25:decr_hits 0
    STAT 25:cas_hits 0
    STAT 25:cas_badval 0
    STAT 26:chunk_size 27120
    STAT 26:chunks_per_page 38
    STAT 26:total_pages 9
    STAT 26:total_chunks 342
    STAT 26:used_chunks 305
    STAT 26:free_chunks 0
    STAT 26:free_chunks_end 37
    STAT 26:mem_requested 7494861
    STAT 26:get_hits 1308
    STAT 26:cmd_set 3876
    STAT 26:delete_hits 0
    STAT 26:incr_hits 0
    STAT 26:decr_hits 0
    STAT 26:cas_hits 0
    STAT 26:cas_badval 0
    STAT 27:chunk_size 33904
    STAT 27:chunks_per_page 30
    STAT 27:total_pages 32
    STAT 27:total_chunks 960
    STAT 27:used_chunks 280
    STAT 27:free_chunks 673
    STAT 27:free_chunks_end 7
    STAT 27:mem_requested 7980338
    STAT 27:get_hits 43377
    STAT 27:cmd_set 115313
    STAT 27:delete_hits 0
    STAT 27:incr_hits 0
    STAT 27:decr_hits 0
    STAT 27:cas_hits 0
    STAT 27:cas_badval 0
    STAT active_slabs 26
    STAT total_malloced 1692051984
    

1 个答案:

答案 0 :(得分:0)

为什么使用memcached 1.4.2版本,最新版本为1.4.13。它可能是发布中的一个错误,但我很难找到,因为大多数系统都使用最新版本。我也遇到了一个问题,不是性质相同但与内存泄漏有关,因此我们对其进行了升级,问题就消失了。这可能不是答案,但如果问题仍然存在于最新的memcached版本中,人们仍可以提供帮助。