GithubHelp home page GithubHelp logo

isabella232 / tcpkali Goto Github PK

View Code? Open in Web Editor NEW

This project forked from launchdarkly/tcpkali

0.0 0.0 0.0 1.73 MB

Fast multi-core TCP and WebSockets load generator.

License: Other

Makefile 0.34% C 94.08% M4 2.55% Shell 0.34% Lex 0.59% Yacc 0.75% C++ 0.31% Python 1.04%

tcpkali's Introduction

About

tcpkali is a high performance TCP and WebSocket load generator and sink.

tcpkali mascot

Features

  • Opens millions of connections from a single host by using available interface aliases.
  • Efficient multi-core operation (--workers); utilizes all available cores by default.
  • Allows opening massive number of connections (--connections)
  • Allows limiting an upstream and downstream of a single connection throughput (--channel-bandwidth-downstream, --channel-bandwidth-upstream or --message-rate)
  • Allows specifying the first and subsequent messages (--message, --first-message).
  • Measures response latency percentiles using HdrHistogram (--latency-marker)
  • Sends stats to StatsD/DataDog (--statsd)

Quick example: testing a web server

tcpkali -em "GET / HTTP/1.1\r\nHost: google.com\r\n\r\n" -r 10 \
        --latency-marker "HTTP/1.1" google.com:80

Install

From packages

OS Package manager Command
Mac OS X Homebrew brew install tcpkali
Mac OS X MacPorts port install tcpkali
FreeBSD pkgng pkg install tcpkali
Linux nix nix-env -i tcpkali

From sources

Install the following packages first:

  • autoconf
  • automake
  • libtool
  • bison
  • flex
  • gcc-c++
  • ncurses-devel or equivalent ncurses package, optional.

Build and install:

test -f configure || autoreconf -iv
./configure
make
sudo make install

Build Status

Usage (Short version)

Usage: tcpkali [OPTIONS] [-l <port>] [<host:port>...]
Where some OPTIONS are:
  -h                   Print this help screen, then exit
  --help               Print long help screen, then exit
  -d                   Dump i/o data for a single connection

  -c <N>               Connections to keep open to the destinations
  -l <port>            Listen on the specified port
  --ws, --websocket    Use RFC6455 WebSocket transport
  -T <Time=10s>        Exit after the specified amount of time

  -e                   Unescape backslash-escaping in a message string
  -1 <string>          Message to send to the remote host once
  -m <string>          Message to repeatedly send to the remote
  -r <Rate>            Messages per second to send in a connection

Variable units and recognized multipliers:
  <N>, <Rate>:  k (1000, as in "5k" is 5000), m (1000000)
  <Time>:       ms, s, m, h, d (milliseconds, seconds, minutes, hours, days)
  <Rate> and <Time> can be fractional values, such as 0.25.

You can get the full list of options using tcpkali --help, from man tcpkali, and by consulting the tcpkali man page source.

Usage Examples

A few command line examples

TCP Examples

Connect to a local web server and do nothing:

tcpkali 127.0.0.1:80

Connect to a local echo server and hammer it with stream of dollars:

tcpkali --message '$' localhost:echo
tcpkali -m '$' localhost:echo

Open 10000 connections to two remote servers:

tcpkali --connections 10000 yahoo.com:80 google.com:80
tcpkali -c 10k yahoo.com:80 google.com:80

Open 100 connections to itself and do nothing:

tcpkali --connections 100 --listen-port 12345 127.0.0.1:12345
tcpkali -c100 -l12345 127.1:12345

Open a connection to itself and send lots of cookies:

tcpkali --listen-port 12345 --message "cookies" 127.0.0.1:12345
tcpkali -l 12345 -m "cookies" 127.1:12345

Listen for incoming connections and throw away data for 3 hours:

tcpkali --listen-port 12345 --duration 3h
tcpkali -l12345 -T3h

WebSocket examples

Open connection to the local WebSocket server, send hello, and wait:

tcpkali --websocket --first-message "hello" 127.0.0.1:80

Open connection to the local server and send tons of empty JSON frames:

tcpkali --websocket --message "\{ws.text}" 127.1:80

Send a binary frame with a picture every second (angle brackets are literal):

tcpkali --ws -m "\{ws.binary <image.png>}" -r1 127.1:80

tcpkali's People

Contributors

alvelcom avatar bpuzon avatar davidn avatar ethercrow avatar siden avatar timofey-barmin avatar vlm 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.