目次

10 Memchached

インストール

# yum --enablerepo=rpmforge-extras install memcached

設定確認

# cat /etc/sysconfig/memcached 
PORT="11211"
USER="nobody"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""

memcacheオプション

# /sbin/chkconfig memcached on

memcached-tool

[root@fl8 ~]# memcached-tool localhost display
  #  Item_Size  Max_age   Pages   Count   Full?  Evicted Evict_Time OOM
  2     120B    535414s      10   82252      no        0        0    0
  3     152B    609763s       1       1      no        0        0    0
  4     192B    535414s       1      15      no        0        0    0
  5     240B    535414s       1      21      no        0        0    0
  6     304B    535414s       1      10      no        0        0    0
  7     384B    535414s       1       5      no        0        0    0
  8     480B  21584579s       1       1      no        0        0    0
  9     600B         0s       1       0      no        0        0    0
 10     752B         0s       1       0      no        0        0    0
 11     944B  21679132s       1       1      no        0        0    0
 12     1.2K         0s       1       0      no        0        0    0
 13     1.4K         0s       1       0      no        0        0    0
 14     1.8K         0s       1       0      no        0        0    0
[root@fl8 ~]# memcached-tool localhost stats
#localhost:11211   Field       Value
         accepting_conns           1
               auth_cmds           0
             auth_errors           0
                   bytes     8662768
              bytes_read   375554929
           bytes_written   263494684
              cas_badval           0
                cas_hits           0
              cas_misses           0
               cmd_flush           0
                 cmd_get      578073
                 cmd_set     1110516
             conn_yields           0
   connection_structures          23
        curr_connections          10
              curr_items       82306
               decr_hits           0
             decr_misses           0
             delete_hits      563948
           delete_misses       79960
               evictions           0
                get_hits      370154
              get_misses      207919
               incr_hits           0
             incr_misses           0
          limit_maxbytes    67108864
     listen_disabled_num           0
                     pid        8768
            pointer_size          64
           rusage_system  335.621977
             rusage_user  368.759939
                 threads           4
                    time  1547695473
       total_connections      547386
             total_items     1094523
                  uptime    21679162
                 version       1.4.4

コマンドでexpire確認

stats items
STAT items:8:number 3
STAT items:8:number_hot 0
STAT items:8:number_warm 0
STAT items:8:number_cold 3
STAT items:8:age_hot 0
STAT items:8:age_warm 0
STAT items:8:age 419
STAT items:8:evicted 0
STAT items:8:evicted_nonzero 0
STAT items:8:evicted_time 0
STAT items:8:outofmemory 0
STAT items:8:tailrepairs 0
STAT items:8:reclaimed 582
STAT items:8:expired_unfetched 582
STAT items:8:evicted_unfetched 0
STAT items:8:evicted_active 0
STAT items:8:crawler_reclaimed 0
STAT items:8:crawler_items_checked 1755
STAT items:8:lrutail_reflocked 9
STAT items:8:moves_to_cold 8680
STAT items:8:moves_to_warm 61
STAT items:8:moves_within_lru 5
STAT items:8:direct_reclaims 0
STAT items:8:hits_to_hot 2385
STAT items:8:hits_to_warm 8
STAT items:8:hits_to_cold 8197
STAT items:8:hits_to_temp 0
END

stats cachedump 8 0
ITEM laraveldev_cache:GmWzeIrowkGtE6KuNY9qiAEt5NWtdcPxiUREOj6V [299 b; 1560297507 s]
ITEM laravel_cache:QalhLisCOenu4r7X2uU0PGMNwRuOkaTN8o1bl8G0 [290 b; 1560218473 s]
ITEM laravel_cache:Sm7mAvIbxCOjU7iqD1zzRUblsJByYIfNkwXb3bsT [304 b; 1560215954 s]
END

get laraveldev_cache:GmWzeIrowkGtE6KuNY9qiAEt5NWtdcPxiUREOj6V
VALUE laraveldev_cache:GmWzeIrowkGtE6KuNY9qiAEt5NWtdcPxiUREOj6V 0 299
a:5:{s:6:"_token";s:40:"UkfTuEzI3EEVG7D2rYFXKICNcPIxa9CxiwqfFD42";s:3:"url";a:0:{}s:9:"_previous";a:1:{s:3:"url";s:63:"https://portal.kumolabo.com:10443/admin/ALTUS/snapshot_schedule";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}s:50:"login_web_59ba36addc2b2f9401580f014c7f58ea4e30989d";i:1;}
END

$ date --date "@1560297507"
Wed Jun 12 08:58:27 JST 2019