文章目录
- 官网下载压缩包
- 自行上传服务器
- 解压
- 准备gcc
- `yum`安装
- 检查`gcc`版本
- 切换到安装目录执行编译
- `redis`默认安装目录
- 准备配置文件(非必须)
- 修改配置文件为后台启动
- `bind`配置(此服务可以接受方访问的`ip`)
- 关闭保护模式
- 开启数据持久化
- 已修改的配置文件启动
- 测试
- 检查`redis`进程
- ` redis-benchmark`性能测试
- 参数
- 案例
- 退出客户端
- 关闭服务
官网下载压缩包
自行上传服务器
解压
准备gcc
redis 是基于
c++
编写的必须要有gcc c++
的环境才可以运行.
yum
安装
检查gcc
版本
切换到安装目录执行编译
redis
默认安装目录
准备配置文件(非必须)
修改配置文件为后台启动
bind
配置(此服务可以接受方访问的ip
)
关闭保护模式
开启数据持久化
已修改的配置文件启动
测试
检查redis
进程
redis-benchmark
性能测试
参数
序号 | 选项 | 描述 | 默认值 |
1 | -h | 指定服务器主机名 | 127.0.0.1 |
2 | -p | 指定服务器端口 | 6379 |
3 | -s | 指定服务器 socket | |
4 | -c | 指定并发连接数 | 50 |
5 | -n | 指定请求数 | 10000 |
6 | -d | 以字节的形式指定 SET/GET 值的数据大小 | 2 |
7 | -k | 1=keep alive 0=reconnect | 1 |
8 | -r | SET/GET/INCR 使用随机 key, SADD 使用随机值 | |
9 | -P | 通过管道传输 请求 | 1 |
10 | -q | 强制退出 redis。仅显示 query/sec 值 | |
11 | –csv | 以 CSV 格式输出 | |
12 | *-l*(L 的小写字母) | 生成循环,永久执行测试 | |
13 | -t | 仅运行以逗号分隔的测试命令列表。 | |
14 | *-I*(i 的大写字母) | Idle 模式。仅打开 N 个 idle 连接并等待。 |
案例
退出客户端
关闭服务