【问题标题】:Memcached using more than max memoryMemcached 使用超过最大内存
【发布时间】:2011-05-24 14:47:43
【问题描述】:

我在 memcache 上安装了一个我想在我的生产环境中使用的安装,但是当我运行了几个测试时,似乎 memcache 即使在它用完所有分配的内存后也没有释放内存,另外我登录并运行了 flush_all 命令,但对象仍在缓存中。 以下是一些测试的输出


memcached-tool

memcache-top v0.6       (default port: 11211, color: on, refresh: 3 seconds)

INSTANCE                USAGE   HIT %   CONN    TIME    EVICT/s READ/s  WRITE/s

127.0.0.1:11211         427.1%  0.0%    18      1.4ms   0.0     244     261.0K

AVERAGE:                427.1%  0.0%    18      1.4ms   0.0     244     261.0K

TOTAL:          4.3MB/  1.0MB           18      1.4ms   0.0     244     261.0K

memcached-tool 127.0.0.1:11211 display


  No  Item_Size  Max_age   Pages   Count   Full?  Evicted Evict_Time OOM

  1     560B         4s       1    1872     yes        0        0 15488

  2     704B        32s       1     559      no        0        0    0

  3     880B         4s       1    1191     yes        0        0 1335

  4     1.1K         9s       1     116      no        0        0    0

  5     1.4K        21s       1      14      no        0        0    0

  6     1.7K         4s       1      17      no        0        0    0

  7     2.1K        84s       1      24      no        0        0    0

  8     2.7K       130s       1      60      no        0        0    0

  9     3.3K        25s       1     290      no        0        0    0

 10     4.2K         9s       1     194      no        0        0    0

 11     5.2K         9s       1     116      no        0        0    0

 15    12.7K       816s       1       1      no        0        0    0

 16    15.9K       769s       1       5      no        0        0    0

 18    24.8K       786s       1       1      no        0        0    0

 21    48.5K       816s       1       1      no        0        0    0

memcached-tool 127.0.0.1:11211 统计数据

 127.0.0.1:11211   Field       Value

     accepting_conns           1

           auth_cmds           0

         auth_errors           0

               bytes     4478060

          bytes_read    23964596

       bytes_written   546642860

          cas_badval           0

            cas_hits           0

          cas_misses           0

           cmd_flush           0

             cmd_get      240894

             cmd_set        4504

         conn_yields           0



  connection_structures          21

    curr_connections          18

          curr_items        4461

           decr_hits           0

         decr_misses           0

         delete_hits           0

       delete_misses           0

           evictions           0

            get_hits       43756

          get_misses      197138

           incr_hits           0

         incr_misses           0

      limit_maxbytes     1048576

 listen_disabled_num           0

                 pid        8731

        pointer_size          64

           reclaimed           0

       rusage_system    5.047232

         rusage_user    4.311344

             threads           4

                time  1306247929

   total_connections        3092

         total_items        4504


              uptime        1240

             version       1.4.5

【问题讨论】:

    标签: memcached memory-management


    【解决方案1】:

    -m 告诉 memcached 使用多少 RAM 来存储项目(以兆字节为单位)。笔记 小心,这不是全球性的 内存限制,所以 memcached 将使用 比你告诉它的内存多几%。 将此设置为安全值。将其设置为 小于 48 兆字节不起作用 在 1.4.x 及更早版本中正确。它会 仍然使用内存。

    来源:https://github.com/memcached/memcached/wiki/ConfiguringServer#commandline-arguments

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-09
      • 1970-01-01
      • 2012-08-30
      • 2017-06-07
      • 1970-01-01
      相关资源
      最近更新 更多