• This repository has been archived on 18/Nov/2020
  • Stars
    star
    1,215
  • Rank 38,569 (Top 0.8 %)
  • Language
    Python
  • License
    Other
  • Created almost 12 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A replacement for AB (Apache Bench)

ATTENTION Boom is going to be replaced by Salvo and then deprecated

Follow the progress and join the party here: https://github.com/tarekziade/salvo

ATTENTION

Boom! is a simple command line tool to send some load to a web app.

Boom! is a script you can use to quickly smoke-test your web app deployment. If you need a more complex tool, I'd suggest looking at Funkload or Locust.

Boom! was specifically written to replace my Apache Bench usage, to provide a few missing features and fix a few annoyances I had with AB.

I have no special ambitions for this tool, and since I have not found any tool like this in the Python-land, I wrote this one.

There are a lot of other tools out there, like Siege which seems very popular.

However, Boom! is a good choice because it works on any platform and is able to simulate thousands of users by using greenlets.

Installation

Boom! requires Gevent and Requests. If you are under Windows I strongly recommend installing Gevent with the xxx-win32-py2.7.exe installer you will find at: https://github.com/surfly/gevent/downloads

Boom! should work with the latest versions.

If you are under Linux, installing the source version is usually a better idea. You will need libev for Gevent.

Example under Ubuntu:

$ sudo apt-get install libev libev-dev python-dev

Then:

$ pip install boom

Basic usage

Basic usage example: 100 queries with a maximum concurrency of 10 users:

$ boom http://localhost:80 -c 10 -n 100
Server Software: nginx/1.2.2
Running 100 queries - concurrency: 10.
Starting the load [===================================] Done

-------- Results --------
Successful calls        100
Total time              0.3260 s
Average                 0.0192 s
Fastest                 0.0094 s
Slowest                 0.0285 s
Amplitude               0.0191 s
RPS                     306
BSI                     Pretty good

-------- Legend --------
RPS: Request Per Second
BSI: Boom Speed Index

Boom! has more options:

$ boom --help
usage: boom [-h] [--version] [-m {GET,POST,DELETE,PUT,HEAD,OPTIONS}]
            [--content-type CONTENT_TYPE] [-D DATA] [-c CONCURRENCY] [-a AUTH]
            [--header HEADER] [--pre-hook PRE_HOOK] [--post-hook POST_HOOK]
            [--json-output] [-n REQUESTS | -d DURATION]
            [url]

Simple HTTP Load runner.

positional arguments:
  url                   URL to hit

optional arguments:
  -h, --help            show this help message and exit
  --version             Displays version and exits.
  -m {GET,POST,DELETE,PUT,HEAD,OPTIONS}, --method {GET,POST,DELETE,PUT,HEAD,OPTIONS}
                        HTTP Method
  --content-type CONTENT_TYPE
                        Content-Type
  -D DATA, --data DATA  Data. Prefixed by "py:" to point a python callable.
  -c CONCURRENCY, --concurrency CONCURRENCY
                        Concurrency
  -a AUTH, --auth AUTH  Basic authentication user:password
  --header HEADER       Custom header. name:value
  --pre-hook PRE_HOOK   Python module path (eg: mymodule.pre_hook) to a
                        callable which will be executed before doing a request
                        for example: pre_hook(method, url, options). It must
                        return a tupple of parameters given in function
                        definition
  --post-hook POST_HOOK
                        Python module path (eg: mymodule.post_hook) to a
                        callable which will be executed after a request is
                        done for example: eg. post_hook(response). It must
                        return a given response parameter or raise an
                        `boom.boom.RequestException` for failed request.
  --json-output         Prints the results in JSON instead of the default
                        format
  -n REQUESTS, --requests REQUESTS
                        Number of requests
  -d DURATION, --duration DURATION
                        Duration in seconds

Calling from Python code

You can trigger load testing from Python code by importing the function boom.boom.load directly, as follows:

from boom.boom import load
result = load('http://example.com/', 1, 1, 0, 'GET', None, 'text/plain', None, quiet=True)

Design

Boom uses greenlets through Gevent to create virtual users, and uses Requests to do the queries.

Using greenlets allows Boom to spawn large amounts of virtual users with very little resources. It's not a problem to spawn 1000 users and hammer a web application with them.

If you are interested in this project, you are welcome to join the fun at https://github.com/tarekziade/boom

Make sure to add yourself to the contributors list if your PR gets merged. And make sure it's in alphabetical order!

More Repositories

1

molotov

Load Testing Tool
Python
452
star
2

salvo

Like Boom, but based on Molotov
Python
220
star
3

smwogger

A smoke test tool for Services described through Swagger
Python
40
star
4

NginxTest

Some helpers to write functional tests against an Nginx server
Python
19
star
5

nuax

Micro-Framework in Lua
Lua
15
star
6

mwcat

MediaWiki Categories Model
Python
10
star
7

blog

CSS
8
star
8

tinap

port forwarding with throttling features
Python
8
star
9

signpic

script to sign pictures
Python
6
star
10

pcard

Python
5
star
11

molosonic

Experiment with Arsenic
Python
5
star
12

grenouille

Station mΓ©tΓ©o
JavaScript
5
star
13

system-metrics

Generates system info metrics
Python
4
star
14

onerpc

RPC through ZeroMQ - using ZeroRPC but with one (or two) extra things
Python
3
star
15

distill-t5

Python
3
star
16

gevent-socketpool

3
star
17

jenkins_scripts

Groovy
2
star
18

tinap_rust

Tinap, but in Rust
Rust
2
star
19

youtube-test

Testing a cached youtube
Python
2
star
20

wsgi-bench

Python
2
star
21

slides

All my slides
HTML
2
star
22

piplay

Raspberry Pi Music Player
2
star
23

bench-db

Python
2
star
24

changelog

chnagelog service
Python
2
star
25

powerhose

C++
2
star
26

whoami

Returns geoloc information + public IP when queried
1
star
27

extensions

Python
1
star
28

livre-python

Exemples du livre
1
star
29

chaussette

placeholder
1
star
30

piproxy

A Pip Proxy to simulate easy_install's allowed_hosts option
Python
1
star
31

moz_genai

Python
1
star
32

pardonmyai

Detect offensive language
Python
1
star
33

distilvit

fine-tuned model for alt-text
Python
1
star
34

ctranslate2-demo

Demo of summarization using ctranslate-2
C++
1
star
35

arduino

having fun with arduino
Arduino
1
star
36

toxmail-pop3

POP3 Tox bridge
Python
1
star
37

update_service

Produces update info
Rust
1
star
38

conditioned-profile

Creates/updates a Firefox profile
Python
1
star
39

heroes

HTML
1
star