Skip to content

A sample project to demonstrate load testing a python flask application with Apache JMeter

Notifications You must be signed in to change notification settings

ChrisCarini/sample-load-test-apache-jmeter

Repository files navigation

sample-load-test-apache-jmeter

A sample project to demonstrate load testing a python flask web application with Apache JMeter.

Quick Start

To get started, simply:

  1. In your terminal, clone this repository, and run the sample server

     git clone git@github.com:ChrisCarini/sample-load-test-apache-jmeter.git
     cd sample-load-test-apache-jmeter
     source setup.sh
     gunicorn -w 8 -b 127.0.0.1:5000 "webapp:create_app()" --access-logfile -
  2. Download Apache JMeter (as of publishing, version 5.4.1 is the latest - this sample assumes you are using that version.)

    • Note: If you use brew on macOS, you can install via brew install jmeter.
  3. Start JMeter in your terminal: jmeter (This should launch the Apache JMeter GUI.)

  4. Install the Throughput Shaping Timer a) In Apache JMeter, select Options, then Plugin Manager a) Click on Available Plugins, then search for Throughput Shaping Timer. Select it (click the checkbox), and Click Apply Changes and Restart JMeter. Apache JMeter - Plugins Manager - Throughput Shaping Timer

  5. In Apache JMeter, open the test_fast_endpoint.jmx file. Make the needed configuration changes - see the " configuration tips" section below.

Configuration Tips

  • Read "How Many Threads I Need To Produce Desired RPS?"; configure the threads accordingly.
  • Change the protocol, domain/IP, port number under the HTTP Request Defaults config element.
  • Change the HTTP Request type and Path under the HTTP GET /fast config element.
  • Change the HTTP headers under the HTTP Header Manager config element.
  • Change the desired QPS / RPS under the Throughput Shaping Timer config element.

References

Apache JMeter

Parameterization / Dynamic URLs

About

A sample project to demonstrate load testing a python flask application with Apache JMeter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published