Posts Tagged ‘memcached



memcached的基本设置:
-p 监听的端口
-l 连接的IP地址, 默认是本机
-d start 启动memcache
d服务
-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 显示帮助
php.ini中的配置:
[Memcache]
; 一个高性能的分布式的内存对象缓存系统,通过在内存里维护一个统一的巨大的hash表,
; 它能够用来存储各种格式的数据,包括图像、视频、文件以及数据库检索的结果等。
; 是否在遇到错误时透明地向其他服务器进行故障转移。
memcache.allow_failover = On
; 接受和发送数据时最多尝试多少个服务器,只在打开memcache.allow_failover时有效。memcache.max_failover_attempts = 20
; 数据将按照此值设定的块大小进行转移。此值越小所需的额外网络传输越多。
; 如果发现无法解释的速度降低,可以尝试将此值增加到32768。
memcache.chunk_size = 8192
; 连接到memcached服务器时使用的默认TCP端口。
memcache.default_port = 11211
; 控制将key映射到server的策略。默认值”standard”表示使用先前版本的老hash策略。
; [...]

下载地址:http://jehiah.cz/projects/memcached-win32/
下载编译好的。
Unzip the binaries in your desired directory (eg. c:\memcached)
Install the service using the command: ‘c:\memcached\memcached.exe -d install’ from either the command line
Start the server from the Microsoft Management Console or by running the following command: ‘c:\memcached\memcached.exe -d start’
Use the server, by default listening to port 11211

上面说明文档,
1.解压memcached(如解压到:C:\memcached)
2.memcached解压后,进入cmd命令行,进入解压目录,运行(’c:\memcached\memcached.exe -d install’)安装memcached
3.启动memcached 运行命令行:’c:\memcached\memcached.exe -d start’
4.服务,默认侦听的端口是1211

至此完成memcached的安装
打开php.ini
找到:extension=php_memcache.dll打开;装的是xampp,所以里面自带有php_memcache.dll,如果没有去网上下载一个
重启apache
运行测试例子;
<?php
$memcache = new Memcache;
$memcache->connect(‘localhost’, 11211) [...]


About this blog

QK31欢迎你的到来.

Photostream

Flash MP3 Player JW

Here is the Music Player. You need to installl flash player to show this cool thing!

search_extends

 

2010年三月
« 二    
1234567
891011121314
15161718192021
22232425262728
293031  

分类目录

标签云


28
Unique
Visitors
Powered By Google Analytics