现在的位置: 首页 > 综合 > 正文

memcache

2013年05月28日 ⁄ 综合 ⁄ 共 1293字 ⁄ 字号 评论关闭

memcached for Windows

This is a port of memcached to the win32 architecture by
Kenneth Dalgleish, based on
Kronuz's
1.2.1 port. This port is not supported by the official memcached team.

Install

The win32 version of memcached can be run both as a NT Service or from the command line. To install memcached as a service, follow the next steps:

  1. Unzip the binaries in your desired directory (eg. c:\memcached)
  2. Install the service using the command: 'c:\memcached\memcached.exe -d install' from the command line
  3. Start the server from the Microsoft Management Console or by running the following command: 'c:\memcached\memcached.exe -d start'
  4. Use the server, by default listening to port 11211 


安装

space@app-48:wget http://memcached.org/latest
space@app-48:tar -zxvf memcached-1.x.x.tar.gz
space@app-48:./configure --prefix=安装目录
space@app-48:make
space@app-48:make install

启动memcache:
  ./memcached -help
  ./memcached -d -m 1024 -u root -p 11211 -c 1024 -p /tmp/memcached.pid 
   启动参数说明:
   -d   选项是启动一个守护进程,
   -m  是分配给Memcache使用的内存数量,单位是MB,默认64MB
   -M  return error on memory exhausted (rather than removing items)
   -u  是运行Memcache的用户,如果当前为root 的话,需要使用此参数指定用户。
   -l   是监听的服务器IP地址,默认为所有网卡。
   -p  是设置Memcache的TCP监听的端口,最好是1024以上的端口
   -c  选项是最大运行的并发连接数,默认是1024
   -P  是设置保存Memcache的pid文件
   -f   <factor>   chunk size growth factor (default: 1.25)
   -I   Override the size of each slab page. Adjusts max item size(1.4.2版本新增)
  也可以启动多个守护进程,但是端口不能重复
停止Memcache进程:
   kill `cat /tmp/memcached.pid`

抱歉!评论已关闭.