All Projects → dachad → Tcpgoon

dachad / Tcpgoon

Licence: mit
tcpgoon, maximum TCP connections tester

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Tcpgoon

Reading
整理阅读过的干货文章, 帖子
Stars: ✭ 318 (+125.53%)
Mutual labels:  goroutine, tcp
Parallec
Fast Parallel Async HTTP/SSH/TCP/UDP/Ping Client Java Library. Aggregate 100,000 APIs & send anywhere in 20 lines of code. Ping/HTTP Calls 8000 servers in 12 seconds. (Akka) www.parallec.io
Stars: ✭ 777 (+451.06%)
Mutual labels:  tcp, tcp-client
Tacopie
C++ TCP Library - NO LONGER MAINTAINED
Stars: ✭ 359 (+154.61%)
Mutual labels:  tcp, tcp-client
Socketify
Raw TCP and UDP Sockets API on Desktop Browsers
Stars: ✭ 67 (-52.48%)
Mutual labels:  tcp, tcp-client
Easytcp
Simple framework for TCP clients and servers. Focused on performance and usability.
Stars: ✭ 60 (-57.45%)
Mutual labels:  tcp, tcp-client
EasyFileTransfer
An easy way to transfer file with any size on network with tcp protocol.
Stars: ✭ 30 (-78.72%)
Mutual labels:  tcp, tcp-client
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (+277.3%)
Mutual labels:  goroutine, tcp
SuperSimpleTcp
Simple wrapper for TCP client and server in C# with SSL support
Stars: ✭ 263 (+86.52%)
Mutual labels:  tcp, tcp-client
Tinytcpserver
A small tcp server working under Mono or .NET (4.0) and provides hooks for handling data exchange with clients (works under mono and .net). Behaviour/protocol/reaction could be specified via custom C# script.
Stars: ✭ 14 (-90.07%)
Mutual labels:  tcp, tcp-client
Tcpmessenger
TCPMessenger is a lightweight and simple Android library to send and receive tcp messages.
Stars: ✭ 12 (-91.49%)
Mutual labels:  tcp, tcp-client
ctsTraffic
ctsTraffic is a highly scalable client/server networking tool giving detailed performance and reliability analytics
Stars: ✭ 125 (-11.35%)
Mutual labels:  tcp, tcp-client
Simpletcp
Simple wrapper for TCP client and server in C# with SSL support
Stars: ✭ 99 (-29.79%)
Mutual labels:  tcp, tcp-client
network
exomia/network is a wrapper library around System.Socket for easy and fast TCP/UDP client & server communication.
Stars: ✭ 18 (-87.23%)
Mutual labels:  tcp, tcp-client
Hprose Nodejs
Hprose is a cross-language RPC. This project is Hprose 2.0 for Node.js
Stars: ✭ 297 (+110.64%)
Mutual labels:  tcp, tcp-client
tcp-net
Build tcp applications in a stable and elegant way
Stars: ✭ 42 (-70.21%)
Mutual labels:  tcp, tcp-client
Bizsocket
异步socket,对一些业务场景做了支持
Stars: ✭ 469 (+232.62%)
Mutual labels:  tcp, tcp-client
QTcpSocket
A simple Qt client-server TCP architecture to transfer data between peers
Stars: ✭ 62 (-56.03%)
Mutual labels:  tcp, tcp-client
AsyncTcpClient
An asynchronous variant of TcpClient and TcpListener for .NET Standard.
Stars: ✭ 125 (-11.35%)
Mutual labels:  tcp, tcp-client
Simpleunitytcp
🖧 Simple Unity Project to show how TCP communication are builded in C# without multi-threading or Unity network (Unet) involved.
Stars: ✭ 22 (-84.4%)
Mutual labels:  tcp, tcp-client
Packetsender
Network utility for sending / receiving TCP, UDP, SSL
Stars: ✭ 1,349 (+856.74%)
Mutual labels:  tcp, tcp-client

tcpgoon

tcpgoon

Codacy Badge Build Status Go Report Card Coverage Status License

TLDR . Description . Usage . Execution using Docker . Installation . Help . Examples . Extra project information . Why do I want to test TCP connections? . Where does the project name come from? . Authors . Especial thanks to... . Development information . TO-DO . Project structure . README maintenance . Testing locally .

TL;DR

Tool to test concurrent connections towards a server listening to a TCP port

Description

  • Given a hostname, port, the number of connections (100 by default), a delay between connections (10ms by default) and an interval between stats updates to the standard output...
  • It will use goroutines to open TCP connections and try to read from them
  • The tool will exit once all connections have been dialed (successfully or not)
  • Exit status different from 0 represent executions where all connections were not established successfully, facilitating the integration in test suites.

Usage

Execution using Docker

See our public docker image and its documentation. The image is being updated continuously; you can bind to specific versions, or to the "latest" tag.

Installation

% go get github.com/dachad/tcpgoon

Help

% tcpgoon --help
tcpgoon tests concurrent connections towards a server listening on a TCP port

Usage:
  tcpgoon [command]

Available Commands:
  help        Help about any command
  run         Run tcpgoon test
  version     Show tcpgoon version

Flags:
  -h, --help   help for tcpgoon

Use "tcpgoon [command] --help" for more information about a command.
% tcpgoon run --help
Run tcpgoon test

Usage:
  tcpgoon run [flags] <host> <port>

Flags:
  -y, --assume-yes         Force execution without asking for confirmation
  -c, --connections int    Number of connections you want to open (default 100)
  -d, --debug              Print debugging information to the standard error
  -t, --dial-timeout int   Connection dialing timeout, in ms (default 5000)
  -h, --help               help for run
  -i, --interval int       Interval, in seconds, between stats updates (default 1)
  -s, --sleep int          Time you want to sleep between connections, in ms (default 10)

Examples

Note: depending on the number of connections you want to open, you may need to increase the number of file descriptors your user supports

Successful execution (connections were opened as expected):

% tcpgoon run myhttpsamplehost.com 80 --connections 4 --sleep 999 -y
Total: 4, Dialing: 0, Established: 0, Closed: 0, Error: 0, NotInitiated: 4
Total: 4, Dialing: 1, Established: 1, Closed: 0, Error: 0, NotInitiated: 2
Total: 4, Dialing: 1, Established: 2, Closed: 0, Error: 0, NotInitiated: 1
Total: 4, Dialing: 1, Established: 3, Closed: 0, Error: 0, NotInitiated: 0
Total: 4, Dialing: 0, Established: 4, Closed: 0, Error: 0, NotInitiated: 0
--- myhttpsamplehost.com(216.58.201.131):80 tcp test statistics ---
Total: 4, Dialing: 0, Established: 4, Closed: 0, Error: 0, NotInitiated: 0
--- tcpgoon execution statistics ---
Total established connections: 4
Max concurrent established connections: 4
Number of established connections on closure: 4
Response time stats for 4 successful connections min/avg/max/dev = 49.892ms/50.205ms/50.74ms/319µs

% echo $?
0

Unsuccessful execution (unable to open connections against the destination host:port):

% tcpgoon run myhttpsamplehost.com 81 --connections 4 --sleep 999 -t 1 -y
Total: 4, Dialing: 0, Established: 0, Closed: 0, Error: 0, NotInitiated: 4
Total: 4, Dialing: 1, Established: 0, Closed: 0, Error: 1, NotInitiated: 2
Total: 4, Dialing: 0, Established: 0, Closed: 0, Error: 3, NotInitiated: 1
Total: 4, Dialing: 0, Established: 0, Closed: 0, Error: 4, NotInitiated: 0
Total: 4, Dialing: 0, Established: 0, Closed: 0, Error: 4, NotInitiated: 0
--- myhttpsamplehost.com(216.58.201.131):81 tcp test statistics ---
Total: 4, Dialing: 0, Established: 0, Closed: 0, Error: 4, NotInitiated: 0
--- tcpgoon execution statistics ---
Total established connections: 0
Max concurrent established connections: 0
Number of established connections on closure: 0
Time to error stats for 4 failed connections min/avg/max/dev = 1ms/1.122ms/1.165ms/37µs

% echo $?
2

Extra project information

Why do I want to test TCP connections?

Stressing TCP connections against a server/application facilitates the detection of bottlenecks/issues limiting the capacity of this server/application to accept/keep a specific (and potentially) large number of parallel connections. Some examples of typical (configuration) issues:

  • OS configuration (TCP backlog, network drivers buffers),
  • number of file descriptors/processes the server can use,
  • application listener properties...

These limitations may pass unnoticed in actual application-l7 stress tests, given other bottlenecks can arise earlier than these limitations, or degradation scenarios and/or special conditions may not be reproduced during the stress tests execution, but in real life (lots of connections queued because of a dependency taking longer to reply than it usually does?)

hping is not an actual option for this use case given it won't complete a 3-way handshake, so the connection will not reach the accept() syscall of your server/application or fill up your TCP backlog.

Where does the project name come from?

Goon: /ɡuːn/ noun informal; noun: goon; plural noun: goons ;
...
2.
NORTH AMERICAN
a bully or thug, especially a member of an armed or security force.
...

thegoon

Authors

Especial thanks to...

Development information

TO-DO

We do use Github issues to track bugs, improvements and feature requests. Do not hesitate to raise new ones, or solve them for us by raising PRs ;)

Project structure

This project uses a layered topology, where cmd (complemented by cmdutil) takes care of commands/flags/arguments and uses mtcpclient, which owns and knows everything about "multiple TCP connections" (including reporting), while tcpclient only cares about managing single TCP connections. tcpserver is just there as a dependency for the other packages' tests.

A shared package (debugging) is also supplied just as a basic mechanism to control debug output.

README maintenance

Do not edit README.md directly, as your changes will be lost. Consider README.src.md and the execution (requires godepgraph and Graphviz) of:

% ./_script/readme_generator

Samples injected in the readme can be found in the _script/readme_generator_samples/ directory.

Dockerhub README requires manual maintenance, bringing relevant aspects from here and adapting cmdusage (by docker run...)

Testing locally

You can use the standard go test command, or use our scripts we also run as CI.

Main tests execution:

% ./_script/test

Emulation of a travis job execution using docker (of course, it needs docker):

% COVERALLS_TOKEN="myToken" ./_script/cibuild-docker

And also emulating a travis job deployment (it publishes new binaries providing successful tests and the right credentials, unless you also use the -r flag / dry-run):

% COVERALLS_TOKEN="myToken" ./_script/cibuild-docker -d
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].