-s <file>
Unix socket path to listen on (disables network support).
# 使用本地的套接字通信,基于内存共享的方式向本机提供服务
-l <ip_addr>
Listen on <ip_addr>; default to INADDR_ANY.
# 监听的地址,默认监听本地所有地址
-d Run memcached as a daemon.
# 将memcached运行为守护进程
-u <username>
Assume the identity of <username> (only when run as root).
# 以指定用户的身份运行memcached
-m <num>
Use <num> MB memory max to use for object storage; the default is 64 megabytes.
# 使用的内存空间,默认为64M
-c <num>
Use <num> max simultaneous connections; the default is 1024.
# 最大并发连接数,默认为1024
-p <num>
Listen on TCP port <num>, the default is port 11211.
# 监听的tcp端口,默认端口为11211
-U <num>
Listen on UDP port <num>, the default is port 11211, 0 is off.
# 监听的udp端口,默认为11211,且设置成0表示关闭
-M Disable automatic removal of items from the cache when out of memory. Additions will
not be possible until adequate space is freed up.
# 禁止使用LRU算法去清理内存
-f <factor>
The default is 1.25.
# 增长因子,默认为1.25
-v Be verbose during the event loop; print out errors and warnings.
# 显示详细信息
-vv Be even more verbose; same as -v but also print client commands and responses.
# 显示更详细的信息
-t <threads>
Number of threads to use to process incoming requests. The default is 4.
# 指明memcached提供服务的线程数,默认为4个
-B <proto>
Specify the binding protocol to use. By default, the server will autonegotiate client
connections. By using this option, you can specify the protocol clients must speak.
Possible options are "auto" (the default, autonegotiation behavior),
"ascii" and "binary".
# 所支持的协议,有两种,ascii和binary,默认是自动选择
stats items
STAT items:1:number 1
STAT items:1:age 12
STAT items:1:evicted 0
STAT items:1:evicted_nonzero 0
STAT items:1:evicted_time 0
STAT items:1:outofmemory 0
STAT items:1:tailrepairs 0
STAT items:1:reclaimed 0
STAT items:1:expired_unfetched 0
STAT items:1:evicted_unfetched 0
END
4.5.3 stats slabs
显示各个slab的信息,包括chunk的大小、数目、使用情况等
stats slabs
STAT 1:chunk_size 96
STAT 1:chunks_per_page 10922
STAT 1:total_pages 1
STAT 1:total_chunks 10922
STAT 1:used_chunks 1
STAT 1:free_chunks 10921
STAT 1:free_chunks_end 0
STAT 1:mem_requested 75
STAT 1:get_hits 10
STAT 1:cmd_set 10
STAT 1:delete_hits 1
STAT 1:incr_hits 0
STAT 1:decr_hits 0
STAT 1:cas_hits 0
STAT 1:cas_badval 0
STAT 1:touch_hits 0
STAT active_slabs 1
STAT total_malloced 1048512
END