Memcached使用的内存超过最大内存 [英] Memcached using more than max memory

查看:487
本文介绍了Memcached使用的内存超过最大内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在memcache上安装了一个要在我的生产环境中使用的安装程序,但是当我运行了几次测试后,memcache似乎没有释放内存,即使它用完了所有分配的内存,也我登录并运行了flush_all命令,但对象仍在高速缓存中. 这是一些测试的结果

i have an installation on memcache which i want to use in my production environment but when i have ran a couple of tests it seems that memcache doesn't free up memory even after it has used up all of it allocated memory, Also i logged in and ran a flush_all command but the objects are still in the cache. Here are outputs from some tests

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统计信息


memcached-tool 127.0.0.1:11211 stats

 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


推荐答案

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

-m tells memcached how much RAM to use for item storage (in megabytes). Note carefully that this isn't a global memory limit, so memcached will use a few % more memory than you tell it to. Set this to safe values. Setting it to less than 48 megabytes does not work properly in 1.4.x and earlier. It will still use the memory.

来源: http://code.google.com/p/memcached/wiki/NewConfiguringServer

这篇关于Memcached使用的内存超过最大内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆