本帖最后由 徐超 于 2015-1-26 21:45 编辑
问题导读
1、什么是Rally?
2、如何进行测试?
Rally 简介
Rally 集成了部署、API测试、压力测试功能(如下图),但我们一般用 devstack 部署,tempest 做 API 测试,因此 Rally 常用于模拟高并发场景的压力测试。Rally 测试 openstack 在并发下 API 的相应时间和请求成功率,从而测试出 openstack 规模和性能。
1. Deploy Rally
- [ DISCUZ_CODE_6 ]nbsp; git clone https://git.openstack.org/stackforge/rally
- [ DISCUZ_CODE_6 ]nbsp; ./rally/install_rally.sh -v #使用 virtualenv 安装 Rally
复制代码
2. Configure Rally
- [ DISCUZ_CODE_7 ]nbsp; source /opt/rally/bin/activate
- [ DISCUZ_CODE_7 ]nbsp; rally deployment create --filename=existing.json --name=openstack # 初始化 Rally,把所需测试 openstack 集群的 keystone url,用户租户信息写入到 existing.json 中
复制代码
- $ rally deployment check # 查看集群的 service
复制代码
- (rally)[root@controller ~]# rally deployment check
- keystone endpoints are valid and following services are available:
- +------------+----------------+-----------+
- | services | type | status |
- +------------+----------------+-----------+
- | ceilometer | metering | Available |
- | cinder | volume | Available |
- | cinderv2 | volumev2 | Available |
- | ec2 | ec2 | Available |
- | glance | image | Available |
- | heat | cloudformation | Available |
- | heat | orchestration | Available |
- | keystone | identity | Available |
- | neutron | network | Available |
- | nova | compute | Available |
- | novav3 | computev3 | Available |
- | s3 | s3 | Available |
- | trove | database | Available |
- +------------+----------------+-----------+
复制代码
3. Benchmark Openstack Peformance
rally/doc/samples/tasks/scenarios/ 包含各个组件的配置文件,直接使用即可,举例:
1)测试 keystone 创建-删除用户性能
- [ DISCUZ_CODE_10 ]nbsp; rally -v task start rally/doc/samples/tasks/scenarios/keystone/create-and-delete-user.json
复制代码
Result:
2)测试 nova 创建-删除虚拟机性能
- [ DISCUZ_CODE_11 ]nbsp; rally -v task start rally/doc/samples/tasks/scenarios/nova/boot-and-delete.json
复制代码
Result:
|