Coder Social home page Coder Social logo

amo-loadtest's Introduction

This is an attempt to run some load tests on addons.mozilla.org (Olympia). The short term goal is to use this to fix write performance issues. We'll see what happens after that.

The tests run using Locust but everything is managed with docker-compose.

Run load tests

Generate some users for a load testing session. Run this from the Olympia repo on the site that you want to load test. For example, to test things out locally, generate this from your local Olympia repo::

./manage.py gen_loadtest_users

Move the loadtest-users.txt file to the data directory of the load test source code repository.

Run a local test

Run master and workers against your local Olympia docker container (by IP address, which may be different for you).

SITE_UNDER_TEST=http://192.168.59.103 docker-compose up -d

Open the Locust dashboard at http://192.168.59.103:8089/

Run load tests from AWS

Generate a loadtest-users.txt file on the server for the website under test similar to how it's documented above.

Start a master

First, boot up a master EC2 instance and do the following things:

Run this to start a master container:

cd src/amo-loadtest
SITE_UNDER_TEST=https://addons.allizom.org \
    docker-compose -f docker-compose-master.yml up -d

Find the IP of your master and check the dashboard. It will be at something like http://ec2-N-N-N-N.us-west-2.compute.amazonaws.com:8089/

Start a worker

You can start as many workers as you want. For each EC2 instance you start, you need to begin by cloning the code, pushing your loadtest-users.txt file, and installing docker just like you would for a master instance. Run this command to start a worker container:

cd src/amo-loadtest
SITE_UNDER_TEST=https://addons.allizom.org \
    MASTER_HOST=ec2-N-N-N-N.us-west-2.compute.amazonaws.com \
    docker-compose -f docker-compose-worker.yml up -d

You'll notice that the $MASTER_HOST var is set to the publicly accessible DNS host that your master is running on.

amo-loadtest's People

Contributors

kumar303 avatar mstriemer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.