2

出于某种原因,目前 memcache 会导致站点响应时间出现峰值。

在其他有关 memcached 数字的问题中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 和 get

问题 #

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

统计数据

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

统计板

.........
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

4

1 回答 1

0

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

于 2012-06-08T15:22:50.807 回答