<span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium 'Times New Roman'; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="text-align: left; line-height: 21px; font-family: simsun; color: rgb(50,62,50); font-size: 14px" class="Apple-style-span">安装libevent: <span class="Apple-converted-space"> 下载 http://www.monkey.org/~provos/libevent/ <span class="Apple-converted-space"> 安装:<font style="line-height: 21px; word-wrap: normal; word-break: normal" color="#45818e"># tar zxvf libevent-1.2.tar.gz <span class="Apple-converted-space"> <span class="Apple-converted-space"> # cd libevent-1.2 <span class="Apple-converted-space"> <span class="Apple-converted-space"> # ./configure –prefix=/usr <span class="Apple-converted-space"> # make <span class="Apple-converted-space"> # make install <span class="Apple-converted-space"> 测试: <span class="Apple-converted-space"> <font style="line-height: 21px; word-wrap: normal; word-break: normal" color="#45818e"># ls -al /usr/lib | grep libevent <span class="Apple-converted-space"> lrwxrwxrwx 1 root root 21 11?? 12 17:38 libevent-1.2.so.1 -> libevent-1.2.so.1.0.3 <span class="Apple-converted-space"> -rwxr-xr-x 1 root root 263546 11?? 12 17:38 libevent-1.2.so.1.0.3 <span class="Apple-converted-space"> -rw-r–r– 1 root root 454156 11?? 12 17:38 libevent.a <span class="Apple-converted-space"> -rwxr-xr-x 1 root root 811 11?? 12 17:38 libevent.la <span class="Apple-converted-space"> lrwxrwxrwx 1 root root 21 11?? 12 17:38 libevent.so -> libevent-1.2.so.1.0.3<font style="line-height: 21px; word-wrap: normal; word-break: normal" color="#45818e">安装服务器sudo apt-get install memcached$ memcached -d -m 50 -p 11211 -u root参数说明 -m 指定使用多少兆的缓存空间;-p 指定要监听的端口; -u 指定以哪个用户来运行安装php 模块sudo apt-get install php5-memcacheMemcache的参数说明:<span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal">-d <span class="Apple-converted-space"> 选项是启动一个守护进程,-m <span class="Apple-converted-space"> 是分配给Memcache使用的内存数量,单位是MB,默认64MB
<p style="padding-bottom: 0px; line-height: 21px; border-right-width: 0px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; border-top-width: 0px; border-bottom-width: 0px; word-break: normal; border-left-width: 0px; padding-top: 0px"><span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal"> <span class="Apple-converted-space"> -M <span class="Apple-converted-space"> return error on memory exhausted (rather than removing items)-u <span class="Apple-converted-space"> 是运行Memcache的用户,如果当前为root 的话,需要使用此参数指定用户。-l <span class="Apple-converted-space"> 是监听的服务器IP地址,默认为所有网卡。-p <span class="Apple-converted-space"> 是设置Memcache的TCP监听的端口,最好是1024以上的端口-c <span class="Apple-converted-space"> 选项是最大运行的并发连接数,默认是1024-P <span class="Apple-converted-space"> 是设置保存Memcache的pid文件
<p style="padding-bottom: 0px; line-height: 21px; border-right-width: 0px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; border-top-width: 0px; border-bottom-width: 0px; word-break: normal; border-left-width: 0px; padding-top: 0px"><span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal"> <span class="Apple-converted-space"> -f <span class="Apple-converted-space"> <span class="Apple-converted-space"> chunk size growth factor (default: 1.25)
<p style="padding-bottom: 0px; line-height: 21px; border-right-width: 0px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; border-top-width: 0px; border-bottom-width: 0px; word-break: normal; border-left-width: 0px; padding-top: 0px"><span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal"> <span class="Apple-converted-space"> -I <span class="Apple-converted-space"> Override the size of each slab page. Adjusts max item size(1.4.2版本新增)
<p style="padding-bottom: 0px; line-height: 21px; border-right-width: 0px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; border-top-width: 0px; border-bottom-width: 0px; word-break: normal; border-left-width: 0px; padding-top: 0px"><span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal"> <span class="Apple-converted-space"> <span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal">也可以启动多个守护进程,但是端口不能重复
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。