rally SLA及existing user参数使用方法

简介:rally除了支持自建临时租户用户来完成测试,还支持使用已经存在的租户用户进行并发测试,本文将介绍如何使用已经存在的用户进行测试,以及SLA参数用法。

rally 支持使用existing usersbenchmarking

操作方法:在创建deployment时,先创建existing.json文件,在该文件中写入已有的用户信息:

{

        "type": "ExistingCloud",

        "auth_url": "http://example.net:5000/v2.0/",

        "region_name": "RegionOne",

        "endpoint_type": "public",

        "admin": {

            "username": "admin",

            "password": "pa55word",

            "tenant_name": "demo"

        },

        "users": [

            {

                "username": "b1",

                "password": "1234",

                "tenant_name": "testing"

            },

            {

                "username": "b2",

                "password": "1234",

                "tenant_name": "testing"

            }

        ]

    }

 

然后创建deployment:

# rally deployment create --file existings_users --name our_cloud

使用rally show(如:rally show images)命令能够查看每个用户的资源。

注:Rally运行benchmarktask时,要在task 配置文件中删除users context,这样便不会创建临用户,而使用已有的用户测试.如:

{

        "NovaServers.boot_and_delete_server": [

            {

                "args": {

                    "flavor": {

                        "name": "m1.tiny"

                    },

                    "image": {

                        "name": "^cirros.*uec$"

                    },

                    "force_delete": false

                },

                "runner": {

                    "type": "constant",

                    "times": 10,

                    "concurrency": 2

                },

                "context": {}

            }

        ]

    }

 

Rally支持SLA

实际操作中,可能需要测试云环境性能极限值,但是容易导致环境崩溃。Rally提供的解决方法是,在task配置文件中定义SLA,一旦超过SLA定义的值,就停止rally运行。

如下所示,若其中一个interation超过10秒或者失败率达到25%以上,就判定此次任务执行失败。此时执行task命令:

# rally task start --abort-on-sla-failure  XXX.json

{

        "NovaServers.boot_and_delete_server": [

            {

                "args": {

                    ...

                },

                "runner": {

                    ...

                },

                "context": {

                    ...

                },

                "sla": {

                    "max_seconds_per_iteration": 10,

                    "failure_rate": {

                        "max": 25

                    }

                }

            }

        ]

}

 

参考文档:http://rally.readthedocs.io/en/latest/tutorial.html

你可能感兴趣的:(rally SLA及existing user参数使用方法)