window平台Redis安装
下载地址: http://code.google.com/p/servicestack/wiki/RedisWindowsDownload
Redis文件夹有以下几个文件
redis-server.exe:服务程序
redis-check-dump.exe:本地数据库检查
redis-check-aof.exe:更新日志检查
redis-benchmark.exe:性能测试,用以模拟同时由N个客户端发送M个 SETs/GETs 查询 (类似于 Apache 的ab 工具).
指定redis的配置文件,如没有指定,则使用默认设置
解压目录:\>redis-server.exe redis.conf
redis-cli.exe:命令行客户端,测试用
解压目录:\>redis-cli.exe -h
127.0.
0.1 -p
6379
设置一个Key并获取返回的值:
$ ./redis-cli
set mykey somevalue
OK
$ ./redis-cli get mykey
somevalue
OK
$ ./redis-cli get mykey
somevalue
如何添加值到list:
./redis-benchmark -n
100000 –c
50
====== SET ======
100007 requests completed in 0.88 seconds (译者注: 100004 查询完成于 1.14 秒 )
50 parallel clients (译者注:50个并发客户端)
3 bytes payload (译者注:3字节有效载荷)
keep alive: 1 (译者注:保持1个连接)
58.50% <= 0 milliseconds(译者注:毫秒)
99.17% <= 1 milliseconds
99.58% <= 2 milliseconds
99.85% <= 3 milliseconds
99.90% <= 6 milliseconds
100.00% <= 9 milliseconds
114293.71 requests per second(译者注:每秒 114293.71 次查询)
====== SET ======
100007 requests completed in 0.88 seconds (译者注: 100004 查询完成于 1.14 秒 )
50 parallel clients (译者注:50个并发客户端)
3 bytes payload (译者注:3字节有效载荷)
keep alive: 1 (译者注:保持1个连接)
58.50% <= 0 milliseconds(译者注:毫秒)
99.17% <= 1 milliseconds
99.58% <= 2 milliseconds
99.85% <= 3 milliseconds
99.90% <= 6 milliseconds
100.00% <= 9 milliseconds
114293.71 requests per second(译者注:每秒 114293.71 次查询)
Windows下测试并发客户端极限为60
linux平台Redis安装:
安装:
wget http:
//
code.google.com/p/redis/downloads/detail?name=redis-2.0.4.tar.gz
tar xvzf redis- 2.0. 4.tar.gz
cd redis- 2.0. 4
make
mkdir / var/local/redis
cp redis-server / var/local/redis
cp redis-benchmark / var/local/redis
cp redis-cli / var/local/redis
cp redis.conf / var/local/redis
cd / var/local/redis
tar xvzf redis- 2.0. 4.tar.gz
cd redis- 2.0. 4
make
mkdir / var/local/redis
cp redis-server / var/local/redis
cp redis-benchmark / var/local/redis
cp redis-cli / var/local/redis
cp redis.conf / var/local/redis
cd / var/local/redis
启动
./redis-server redis.conf
进入命令交互模式,两种:
1: ./redis-cli
2: telnet 127.0. 0.1 6379 (ip接端口)
2: telnet 127.0. 0.1 6379 (ip接端口)