Load testing your serverless microservice

First, you need to have a serverless microservice stack running with ./build-package-deploy-lambda-dynamo-data-api.sh, and have loaded data into the DynamoDB table using the python3 dynamo_insert_items_from_file.py Python script.

Then install Locust, if it hasn't already been installed with the other packages in requirements.txt:

$ sudo pip3 install locustio 

Locust (https://docs.locust.io) is an easy-to-use load-testing tool with a web metrics and monitoring interface. It allows you to define user behavior using Python code and can be used to simulate millions of users over multiple machines.

To use Locust, you first need to create a Locust Python file where you define the Locust tasks. The HttpLocust ...

Get Building Serverless Microservices in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.