|
復(fù)制代碼 代碼如下:
-p <num> 監(jiān)聽的TCP端口(默認(rèn): 11211)
-U <num> UDP監(jiān)聽端口 (默認(rèn): 11211, 0 時(shí)關(guān)閉)
-d 以守護(hù)進(jìn)程方式運(yùn)行
-u <username> 運(yùn)行運(yùn)行 Memcached的賬戶 非root用戶
-m <num> 最大的內(nèi)存使用單位是MB 默認(rèn)是64MB
-c <num> 軟連接數(shù)量默認(rèn)是1024
-v 輸出警告和錯誤信息
-vv 打印客戶端的請求和返回信息
-h 打印幫助信息
-i 打印memcached和libevent的版權(quán)信息
-l <ip_addr> 綁定地址 (默認(rèn):所有都允許,無論內(nèi)外網(wǎng)或者本機(jī)更換IP,有安全隱患,若設(shè)置為127.0.0.1就只能本機(jī)訪問)
-P <file> 將PID寫入文件<file>,這樣可以使得后邊進(jìn)行快速進(jìn)程終止, 需要與 -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服務(wù)器的進(jìn)程ID |
uptime | 服務(wù)器已經(jīng)運(yùn)行的秒數(shù) |
time | 服務(wù)器當(dāng)前的unix時(shí)間戳 |
version | memcache版本 |
pointer_size | 當(dāng)前操作系統(tǒng)的指針大小(32位系統(tǒng)一般是32bit) |
rusage_user | 進(jìn)程的累計(jì)用戶時(shí)間 |
rusage_system | 進(jìn)程的累計(jì)系統(tǒng)時(shí)間 |
curr_items | 服務(wù)器當(dāng)前存儲的items數(shù)量 |
total_items | 從服務(wù)器啟動以后存儲的items總數(shù)量 |
bytes | 當(dāng)前服務(wù)器存儲items占用的字節(jié)數(shù) |
curr_connections | 當(dāng)前打開著的連接數(shù) |
total_connections | 從服務(wù)器啟動以后曾經(jīng)打開過的連接數(shù) |
connection_structures | 服務(wù)器分配的連接構(gòu)造數(shù) |
cmd_get | get命令(獲取)總請求次數(shù) |
cmd_set | set命令(保存)總請求次數(shù) |
get_hits | 總命中次數(shù) |
get_misses | 總未命中次數(shù) |
evictions | 為獲取空閑內(nèi)存而刪除的items數(shù)(分配給memcache的空間用滿后需要刪除舊的items來得到空間分配給新的items) |
bytes_read | 總讀取字節(jié)數(shù)(請求字節(jié)數(shù)) |
bytes_written | 總發(fā)送字節(jié)數(shù)(結(jié)果字節(jié)數(shù)) |
limit_maxbytes | 分配給memcache的內(nèi)存大小(字節(jié)) |
threads | 當(dāng)前線程數(shù) |
4、Memcache 啟動tips
a:監(jiān)聽內(nèi)網(wǎng)地址
b:修改默認(rèn)端口號
c:設(shè)置最大連接數(shù),最大內(nèi)存占用數(shù)
php技術(shù):淺析memcache啟動以及telnet命令詳解,轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。