浅析memcache启动以及telnet命令详解_PHP
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Freigeben: 2016-06-01 12:05:17
Original
868 Leute haben es durchsucht
memcache
1、启动Memcache 常用参数
复制代码 代码如下:
-p
监听的TCP端口(默认: 11211)
-U UDP监听端口 (默认: 11211, 0 时关闭)
-d 以守护进程方式运行
-u 运行运行 Memcached的账户 非root用户
-m 最大的内存使用单位是MB 默认是64MB
-c 软连接数量默认是1024
-v 输出警告和错误信息
-vv 打印客户端的请求和返回信息
-h 打印帮助信息
-i 打印memcached和libevent的版权信息
-l 绑定地址 (默认:所有都允许,无论内外网或者本机更换IP,有安全隐患,若设置为127.0.0.1就只能本机访问)
-P 将PID写入文件,这样可以使得后边进行快速进程终止, 需要与 -d 一起使用
2、Memcache telnet 常用命令
COMMAND |
DESCRIPTION |
EXAMPLE |
get |
Reads a value |
get mykey |
set |
Set a key unconditionally |
set mykey 0 60 5 |
add |
Add a new key |
add newkey 0 60 5 |
replace |
Overwrite existing key |
replace key 0 60 5 |
append |
Append data to existing key |
append key 0 60 15 |
prepend |
Prepend data to existing key |
prepend key 0 60 15 |
incr |
Increments numerical key value by given number |
incr mykey 2 |
decr |
Decrements numerical key value by given number |
decr mykey 5 |
delete |
Deletes an existing key |
delete mykey |
flush_all |
Invalidate specific items immediately |
flush_all |
Invalidate all items in n seconds |
flush_all 900 |
stats |
Prints general statistics |
stats |
Prints memory statistics |
stats slabs |
Prints memory statistics |
stats malloc |
Print higher level allocation statistics |
stats items |
|
stats detail |
|
stats sizes |
Resets statistics |
stats reset |
version |
Prints server version. |
version |
verbosity |
Increases log level |
verbosity |
quit |
Terminate telnet session |
quit |
3、stats命令详解
pid |
memcache服务器的进程ID |
uptime |
服务器已经运行的秒数 |
time |
服务器当前的unix时间戳 |
version |
memcache版本 |
pointer_size |
当前操作系统的指针大小(32位系统一般是32bit) |
rusage_user |
进程的累计用户时间 |
rusage_system |
进程的累计系统时间 |
curr_items |
服务器当前存储的items数量 |
total_items |
从服务器启动以后存储的items总数量 |
bytes |
当前服务器存储items占用的字节数 |
curr_connections |
当前打开着的连接数 |
total_connections |
从服务器启动以后曾经打开过的连接数 |
connection_structures |
服务器分配的连接构造数 |
cmd_get |
get命令(获取)总请求次数 |
cmd_set |
set命令(保存)总请求次数 |
get_hits |
总命中次数 |
get_misses |
总未命中次数 |
evictions |
为获取空闲内存而删除的items数(分配给memcache的空间用满后需要删除旧的items来得到空间分配给新的items) |
bytes_read |
总读取字节数(请求字节数) |
bytes_written |
总发送字节数(结果字节数) |
limit_maxbytes |
分配给memcache的内存大小(字节) |
threads |
当前线程数 |
4、Memcache 启动tips
a:监听内网地址
b:修改默认端口号
c:设置最大连接数,最大内存占用数
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Neueste Artikel des Autors
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31