How to do load test for deployed bot?
I had a project which I need a load test for deployed bot. There was a blog post, but it doesn't give the detailed description how to configure load test environment for deployed bot so I wrote this tutorial.
1. Prerequisite
Up and running bot! (If not, you can deploy one of the sample bots on github)
2. Prepare a VM for Load Testing
Create a VM for Load Test Client (For Windows OS)
This is the original blog post that I followed to setup the environment.
Change default setting of VM
-
Turn off IE Enhanced Security Configuration
To install the following programs, you need to change the security setting for IE.
Install JDK
- Download JDK
- Add system variable for "JAVA_HOME"
- Add this to the PATH
You need to restart your VM after edit environment variable.
Install Apache JMeter
- Download Apache JMeter.
- Extract zip file.
Install Apache Maven
-
Download Apache Maven
-
Extract zip file
Clone BotServiceStressToolkit project and create JAR file
-
Clone BotServiceStressToolkit project on Github
If you want to use git clone, you need to download git(https://git-scm.com/) first.
-
Move to "BotServiceStressToolkit" directory
-
Execute following command.
mvn clean package
-
Copy the JAR file under target folder after step3 completed.
3. Execute Load Testing for the bot
Configuration for test VM on Azure Portal
I use 45678 port for this, but this can be any port number you prefer.
- Open Azure portal and go to the VM you create
- Go to network setting page
- Add inbound port rule like below.
Configuration for Apache JMeter
-
Update the configuration info for deployed bot.
Those are the field you need to update
- Bot URL: http://your-app-service-name.azurewebsites.net/api/messages
- Callback URL: http://your-vm-public-ip:your-port-number
- Callback Server Listen Host: your-vm-private-ip
- Callback Server Listen Port: your-port-number
-
Increase thread 1 to 100(as many as you want) for load test.
You can add assertion and so on. If you want to know more detail on this, please read the blog post below!