Generate HTTP load and plot the results in real-time

Overview

ali

codecov.io Code Coverage Release Go Doc

A load testing tool capable of performing real-time analysis, inspired by vegeta and jplot.

Screenshot

ali comes with an embedded terminal-based UI where you can plot the metrics in real-time, so lets you perform real-time analysis on the terminal.

Installation

Binary releases are available through here.

Via Homebrew

brew install nakabonne/ali/ali

Via APT

wget https://github.com/nakabonne/ali/releases/download/v0.5.4/ali_0.5.4_linux_amd64.deb
apt install ./ali_0.5.4_linux_amd64.deb

Via RPM

rpm -ivh https://github.com/nakabonne/ali/releases/download/v0.5.4/ali_0.5.4_linux_amd64.rpm

Via Pacman

pacman -S ali

Via Go

Note that you may have a problem because it downloads an untagged binary.

go get github.com/nakabonne/ali

Via Docker

docker run --rm -it nakabonne/ali ali

Usage

Quickstart

ali http://host.xz

Replace http://host.xz with the target you want to issue the requests to. Press Enter when the UI appears, then the attack will be launched with default options (rate=50, duration=10s).

Options

ali -h
Usage:
  ali [flags] 

Flags:
  -b, --body string         A request body to be sent.
  -B, --body-file string    The path to file whose content will be set as the http request body.
  -c, --connections int     Amount of maximum open idle connections per target host (default 10000)
      --debug               Run in debug mode.
  -d, --duration duration   The amount of time to issue requests to the targets. Give 0s for an infinite attack. (default 10s)
  -H, --header strings      A request header to be sent. Can be used multiple times to send multiple headers.
      --local-addr string   Local IP address. (default "0.0.0.0")
  -M, --max-body int        Max bytes to capture from response bodies. Give -1 for no limit. (default -1)
  -W, --max-workers uint    Amount of maximum workers to spawn. (default 18446744073709551615)
  -m, --method string       An HTTP request method for each request. (default "GET")
      --no-http2            Don't issue HTTP/2 requests to servers which support it.
  -K, --no-keepalive        Don't use HTTP persistent connection.
  -r, --rate int            The request rate per second to issue against the targets. Give 0 then it will send requests as fast as possible. (default 50)
      --resolvers string    Custom DNS resolver addresses; comma-separated list.
  -t, --timeout duration    The timeout for each request. 0s means to disable timeouts. (default 30s)
  -v, --version             Print the current version.
  -w, --workers uint        Amount of initial workers to spawn. (default 10)

Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

Examples

For basic usage:

ali --rate=500 --duration=5m http://host.xz

For an infinite attack:

ali --duration=0 http://host.xz

For an attack with the POST method:

ali --body-file=/path/to/foo.json --method=POST http://host.xz

Charts

Press l (or h) to switch the displayed chart. On all charts, you can click and drag to select a region to zoom into.

Latency

Screenshot

The X-axis represents the request counts and the Y-axis represents latencies in milliseconds.

Percentiles

Screenshot

You can see how the 50th, 90th, 95th, and 99th percentiles are changing.

Bytes

TBA

Histogram

TBA

Features

Plot in real-time

Screenshot

Visualize the attack progress

This will help you during long tests.

Screenshot

Mouse support

With the help of mum4k/termdash can be used intuitively.

Screenshot

Acknowledgements

This project would not have been possible without the effort of many individuals and projects but especially vegeta for the inspiration and powerful API. Besides, ali is built with termdash (as well as termbox-go) for the rendering of all those fancy graphs on the terminal. They clearly stimulated an incentive to creation. A big "thank you!" goes out to all those who helped.

Issues
  • fix panic when doing Ctrl-C in the middle of a attack

    fix panic when doing Ctrl-C in the middle of a attack

    this should fix #23.

    As the Attack method is now sending messages to the 'metricsCh', and it looks at the Context being complete (completely stopping the attack), I simply removed the channel send that was being done to metricsCh in gui/keybinds.go . This fixed the panic and the Ctrl-C issue for me.

    opened by brenol 8
  • Unable to install with

    Unable to install with "brew install nakabonne/ali/ali"

    I noticed this when installing:

    $ brew install nakabonne/ali/ali
    ==> Tapping nakabonne/ali
    Cloning into '/usr/local/Homebrew/Library/Taps/nakabonne/homebrew-ali'...
    remote: Enumerating objects: 39, done.
    remote: Counting objects: 100% (39/39), done.
    remote: Compressing objects: 100% (26/26), done.
    remote: Total 39 (delta 13), reused 0 (delta 0), pack-reused 0
    Receiving objects: 100% (39/39), 6.26 KiB | 6.26 MiB/s, done.
    Resolving deltas: 100% (13/13), done.
    Tapped 1 formula (26 files, 33.6KB).
    Error: No available formula or cask with the name "nakabonne/ali/ali".
    ==> Searching for similarly named formulae...
    This similarly named formula was found:
    ali
    To install it, run:
      brew install ali
    ~ ⌚ 9:02:48
    $ brew install ali              
    ==> Installing ali from nakabonne/ali
    ==> Downloading https://github.com/nakabonne/ali/releases/download/v0.3.3/ali_0.3.3_darwin_amd64.tar.gz
    ==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/294836885/d0365a80-0
    ######################################################################## 100.0%
    🍺  /usr/local/Cellar/ali/0.3.3: 5 files, 6.2MB, built in 2 seconds
    ```
    `
    help wanted 
    opened by rmgval 7
  • Requestparameter as cli options

    Requestparameter as cli options

    Hey,

    please add the feature to add cli options for the http(s) requests like ali --targeturl=http://www.foo.bar --duration=10 --timeout=30 an so on. Thank you.

    enhancement 
    opened by AndreasHerold 7
  • Fix brew install command

    Fix brew install command

    Docs suggest brew install nakabonne/ali/ali however Homebrew responds with an error, I believe the correct series of commands is brew tap nakabonne/ali followed by brew install ali

    brew install nakabonne/ali/ali
    ==> Tapping nakabonne/ali
    Cloning into '/usr/local/Homebrew/Library/Taps/nakabonne/homebrew-ali'...
    Error: No available formula or cask with the name "nakabonne/ali/ali".
    ==> Searching for similarly named formulae...
    This similarly named formula was found:
    ali
    To install it, run:
      brew install ali
    brew install ali
    ==> Installing ali from nakabonne/ali
    
    opened by agoddard 6
  • Plot more metrics in real-time

    Plot more metrics in real-time

    It would be nice if it's able to press Ctrl-i to switch between charts.

    • [x] Plot 50th, 90th, 95th, and 99th percentiles #66
    • [ ] Bytes In and Bytes Out
    • [ ] Status Codes
    • [ ] Histogram #63
    • [ ] ~Workers running in concurrent~
    enhancement 
    opened by nakabonne 6
  • Header values containing comma won't work

    Header values containing comma won't work

    First of all: Thanks heaps for this wonderful tool. I am absolutely loving it. Great work, thanks!

    I just noticed headers are declared as StringSliceVarP:

    flagSet.StringSliceVarP(&c.headers, "header", "H", []string{}, "A request header to be sent. Can be used multiple times to send multiple headers.")

    Why allow comma separated values within the --header flag? I think for header values it's a common use case to have them contain a comma separated list of values (i.e. user groups).

    Solution: Switch to StringArrayVarP and force users to supply multiple --header flags to define all header fields.

    So instead of:

    ali --header "key1:value1,key2:value2"
    

    Use this:

    ali --header "groups:group1,group2,group3" --header "user:username"
    

    What do you think?

    good first issue 
    opened by boggyhole 5
  • Panic when running at high rate

    Panic when running at high rate

    What's happened

    ali -r 0 -d 2s http://host.xz
    

    Then: image

    Possible Causes

    It's probably due to the time it takes to draw to all the charts. Maybe we should each spawn goroutine. https://github.com/nakabonne/ali/blob/2711e42b6d038296c100fd2e8a0fdf0ce84996af/gui/drawer.go#L66-L84

    bug 
    opened by nakabonne 5
  • percentiles chart

    percentiles chart

    This PR adds percentiles chart support, which can be enabled with Ctrl-(P) ercentiles.

    You can change to latencies chart again Latencies chart with Ctrl-(L) atencies.

    As I'm not sure we're "hiding" this functionality under a shortcut, I did not update the README yet.

    Added a utility function to create charts with legends. (preparing for bytes-in/bytes-out or any other metric) Added a utility type so we can easily create charts with legends (chartLegend)

    Although it's working correctly, I few like there are a few improvements that can be made (specially in gui/gui.go).

    This PR also fixes a few issues I noticed while using ali:

    • Percentiles (text) where not being updated correctly. This was happening because vegeta.Metrics only set P50/90... when (*vegeta.Metrics).Close() is called. I modified newMetrics to calculate quantiles as newMetrics is called.
    • Also fixed the handling of chartCh and metrics. The way it was, it could not calculate floating point values (as when appending it calculated value/time.Millisecond. As time.Millisecond is an int64, it means everything was being rounded to either 0s or 1.0s), not allowing us to calculate 500ms as 0.5s.

    It also allows texts to be customized (with cellColors - this is necessary because of Legends, which we want to have the same color as its own Series).

    This is how it looks: image

    I feel like adding values to charts is way too manual, at the moment. Perhaps adding a type that holds a function which extracts metrics (from vegeta.Metrics) to a lineChart is a good idea?

    opened by brenol 5
  • Workaround race contition in drawer.redrawMetrics()

    Workaround race contition in drawer.redrawMetrics()

    This is my current workaround I am using for the issue #111 (fatal error: concurrent map iteration and map write) to guard against concurrent access to the shared map StatusCodes accross ali and its library tsenart/vegeta

    opened by fedorlitau 4
  • Support HTTP2 option

    Support HTTP2 option

    This PR makes it possible to switch to send HTTP/2 requests when supported by the server. Also found that connections is not passed to the attacker.Options struct while rebasing, fixed that as well :smiley:

    Added a flag --http2 for switching to HTTP/2

    mayadata:ali$ ./ali --help
    Usage:
      ali [flags] <target URL>
    
    Flags:
      -b, --body string         A request body to be sent.
      -B, --body-file string    The path to file whose content will be set as the http request body.
      -c, --connections int     Amount of maximum open idle connections per target host (default 10000
          --debug               Run in debug mode.
      -d, --duration duration   The amount of time to issue requests to the targets. Give 0s for an infinite attack. (default 10s)
      -H, --header strings      A request header to be sent. Can be used multiple times to send multiple headers.
          --http2               Issue HTTP/2 requests to servers which support it. (default true) (default true)
      -k, --keepalive           Use HTTP persistent connection. (default true)
      -M, --max-body int        Max bytes to capture from response bodies. Give -1 for no limit. (default -1)
      -W, --max-workers uint    Amount of maximum workers to spawn. (default 18446744073709551615)
      -m, --method string       An HTTP request method for each request. (default "GET")
      -r, --rate int            The request rate per second to issue against the targets. Give 0 then it will send requests as fast as possible. (default 50)
      -t, --timeout duration    The timeout for each request. 0s means to disable timeouts. (default 30s)
      -v, --version             Print the current version.
      -w, --workers uint        Amount of initial workers to spawn. (default 10)
    
    Examples:
      ali --duration=10m --rate=100 http://host.xz
    
    Author:
      Ryo Nakao <[email protected]>
    
    opened by shubham14bajpai 4
  • zoom: undo with right click?

    zoom: undo with right click?

    Took me sometime to notice we can undo a Zoom with the mouse scroll (why? Not sure. Perhaps documentation in the README will do), but I thought that we can simulate zoom-outs with a mouse right click.

    Does it make sense to you? (Zoom in with selection; zoom out with right click)

    opened by brenol 4
  • Graph does not show all requests

    Graph does not show all requests

    When the request number is very big, Ali shows graph of partial data. See the below screenshot, it's showing 14707 requests out of 75000 in histogram.

    Screen Shot 2022-03-05 at 9 36 11 AM

    Also, how to make ali wait for requests to finish after the duration? Seems like ali just exits as soon as the duration ends.

    opened by imraan-go 2
  • featreq: support for multiple URLs

    featreq: support for multiple URLs

    It would be nice to be able to specify a list of URLs to send traffic to.

    Not sure how best to handle the division of URLs vs traffic, but for my personal needs a simple round-robin across the URLs would work. I.e. with 2 URLs: request1 -> url1, request2 -> url2, request3 -> url1, request4 -> url2, etc.

    enhancement 
    opened by iggy 2
  • How do I post multipart/form-data

    How do I post multipart/form-data

    Hello there

    I got this curl command which post some form-data

    curl -iL -X POST "http://127.0.0.1:4001/get_sep_data/" -H "accept: application/json" -H "Authorization: Bearer XXXXXXXX" -H "Content-Type: multipart/form-data" -F "url_1=https://i.ytimg.com/vi/-TnUwv9i-4g/maxresdefault.jpg"

    How do I do this with Ali?

    Thank you

    help wanted 
    opened by Dani4kor 3
  • Export Functionality

    Export Functionality

    Would love some export functionality of all the data that is collected.

    Simplest export would be a "CSV" file where each line is latency & start time of each request in order they were made.

    Eventually we could expand this to include other things about the request like the response size, start timestamps, number of request there were in parallel when you started it etc.

    I don't want to export processed data. Since they're fairly basic calculations I don't think that weight should fall on this tool; as it is not its main focus.

    enhancement 
    opened by lordlycastle 13
Releases(v0.7.5)
Owner
Ryo Nakao
Hej!
Ryo Nakao
Real-time HTTP Intrusion Detection

teler Real-time HTTP Intrusion Detection Contribute · What's new · Report Bug · Request Feature teler is an real-time intrusion detection and threat a

Kitabisa 1.6k May 10, 2022
Lightweight http response time based load balancer written in Go

HTTP Load Balancer Specifications http servers should always return time taken to proceed request in headers as EXECUTION_TIME in ms this load balance

Gaëtan 0 Feb 22, 2022
PinGo is a standalone and feature-rich tool for common IP-based reachability checking tasks. Ping or Trace and Observe in real-time the statistics.

pingo As a network champion from designing and implementing to troubleshooting large scale networks - I know that is usually not easy for administrato

Jerome Amon 2 Feb 25, 2022
A Realtime API Gateway used with NATS to build REST, real time, and RPC APIs, where all your clients are synchronized seamlessly.

Realtime API Gateway Synchronize Your Clients Visit Resgate.io for guides, live demos, and resources. Resgate is a Go project implementing a realtime

Resgate.io - Synchronize Your Clients 567 Apr 13, 2022
SubCenter is a middleware that integrate task subscriptions and real-time push

Subscription Center SubCenter是一个集成各种任务并进行实时推送的中间件,本身不提供数据与推送服务。

Zhimin Sun 4 Feb 19, 2022
Go-random-chat - Fast and scalable real-time random chat written in go

Go Random Chat Fast and scalable real-time random chat written in go. Features:

Hao-Ming, Hsu 5 Apr 14, 2022
Jswhois - Whois lookup results in json format

jswhois -- whois lookup results in json format jswhois(1) is a tool to look up a

Jan Schaumann 31 Mar 22, 2022
Walrus 🕑 Real-time event streaming platform built on top of gRPC streams

Walrus ?? Real-time event streaming platform built on top of gRPC streams Table of Contents About the project Built With How it works Getting Started

Matheus Mosca 13 Feb 14, 2022
Schema-free, document-oriented streaming database that optimized for monitoring network traffic in real-time

Basenine Schema-free, document-oriented streaming database that optimized for monitoring network traffic in real-time. Featured Aspects Has the fastes

UP9 34 May 5, 2022
Go http real ip header parser

remoteaddr Go http real ip header parser module A forwarders such as a reverse proxy or Cloudflare find the real IP address from the requests made to

Netinternet 15 Mar 30, 2022
Ephemeral One Time/Build-Time gRPC TLS PKI system.

PkiSauce Ephemeral Build Time TLS PKI saucing for your intra services GRPC (or not) communications. Description A simple attempt to avoid deploying co

Ermites.IO 3 Dec 14, 2021
Demo of EdgeX Foundry Ireland (or Jakarta) release with real Modbus, SNMP and GPIO pin devices

Ireland Demo This demo shows the Ireland (or Jakarta - it works for both) release of EdgeX with the following devices: Comet Systems T0310 temperature

Jim White 0 Nov 6, 2021
Laptop Booking Application in Golang and gRPC, load-balancing with NGINX, and fully compatible with HTTPS OpenAPI v3

Laptop Booking Application in Golang and gRPC Goals GitHub CI & Coverage Badge Serialize protobuf messages Create laptop unary gRPC Search laptop Serv

Tien La 2 Feb 14, 2022
Simple, fast and scalable golang rpc library for high load

gorpc Simple, fast and scalable golang RPC library for high load and microservices. Gorpc provides the following features useful for highly loaded pro

Aliaksandr Valialkin 648 Apr 26, 2022
High-performance PHP application server, load-balancer and process manager written in Golang

RoadRunner is an open-source (MIT licensed) high-performance PHP application server, load balancer, and process manager. It supports running as a serv

Spiral Scout 6.4k May 10, 2022
gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era.

gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era. Current status: Maintenance mode, accepting PRs. Currently in

Yaroslav Pogrebnyak 1.7k May 7, 2022
ZheTian Powerful remote load and execute ShellCode tool

ZheTian ZheTian Powerful remote load and execute ShellCode tool 免杀shellcode加载框架 命令详解 -u:从远程服务器加载base64混淆后的字节码。 -r:从本地文件内读。 -s:读取无修改的原始文件,只能从本地加载 -o:参数

一曲成殇 362 May 10, 2022