標籤:
:
http://s3.amazonaws.com/downloads.northscale.com/memcached-win64-1.4.4-14.zip
http://s3.amazonaws.com/downloads.northscale.com/memcached-win32-1.4.4-14.zip
1. 在終端(也即cmd命令介面)下輸入 ‘c:\memcached\memcached.exe -d install’ 安裝
2. 再輸入: ‘c:\memcached\memcached.exe -d start’ 啟動。
NOTE: 以後memcached將作為windows的一個服務每次開機時自動啟動。這樣伺服器端已經安裝完畢了。
That is it, now your memcached server is installed and is listening to port 11211.
There is one more thing left to do. By default, server is set to 64Mb memory limit, which is too small. To correct, go to Registry Editor and find key
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/memcached Server .
Change the ImagePath entry to:
“C:/memcached/memcached.exe” -d runservice -m 512
This way you will use 512 Mb memory limit for your server.
停止memcached:
D:\wamp_win7\bin\memcached-win32-1.4.4-14> memcached.exe -d stop
卸載memcached:
D:\wamp_win7\bin\memcached-win32-1.4.4-14> memcached.exe -d uninstall
相關問題:
1、設定最大佔用記憶體後好像沒起作用。
-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.
2、在同一個程式集裡將一個值放入到memcache裡,馬上去時可以取到,但是在另一個程式集裡取的時候取不到,或者telnet也拿不到值。
可能問題及解決辦法:
a. 儲存的值序列化後不同類型,則需要將其更新為同一類型,建議使用同一的常見類型,如string,int等,放入string可以拼成一個xml字串,然後到使用的時候在做解析
b. 很有可能是memcache池已經滿了,可以設定<socketPool minPoolSize="100" maxPoolSize="1000" connectionTimeout="00:10:00" deadTimeout="00:02:00"/>
memcached基本參數設定:
-p 監聽的連接埠
-l 串連的IP地址, 預設是本機
-d start 啟動memcached服務
-d restart 重起memcached服務
-d stop|shutdown 關閉正在啟動並執行memcached服務
-d install 安裝memcached服務
-d uninstall 卸載memcached服務
-u 以的身份運行 (僅在以root啟動並執行時候有效)
-m 最大記憶體使用量,單位MB。預設64MB
-M 記憶體耗盡時返回錯誤,而不是刪除項
-c 最大同時串連數,預設是1024
-f 塊大小增長因子,預設是1.25
-n 最小分配空間,key+value+flags預設是48
-h 顯示協助
memcached在windows安裝