Git Product home page Git Product logo

consul-bench's Introduction

consul-bench

consul-bench is a small tool to generate load on a Consul cluster by running blocking queries against a service. It can automatically register service instances on startup to simulate a large number of nodes/instances. Autoregistered instances can be configured to flap (go between critical and passing state) on configurable interval.

Examples

With an existing service

consul-bench -service my-service -watchers 300

Will run 300 /v1/health/service/my-service?wait=10m&stale blocking queries in parallel.

Auto register N service instances

consul-bench -service my-fake-service -register 200 -flap-interval 10s -watchers 500

Will register 200 instances of "my-fake-service", make each instance flap every 10 seconds and run 500 blocking queries in parallel.

Deregister

Registered instances are not deregistered when exiting however they will be deregistered after 6 * -flap-interval (or 20m if no -flap-interval is given) using deregister_critical_service_after. If you want to immediatly deregister them, use consul-bench -service my-service -deregister. Note that this will deregister all instance of the service wether they were registered by consul-bench or not.

Full options

Usage of consul-bench:
  -consul string
    	Consul address (default "127.0.0.1:8500")
  -dc string
    	When using rpc, the consul datacenter (default "dc1")
  -deregister
    	Deregister all instances of -service
  -flap-interval duration
    	If -register is given, flap each instance between critical and passing state on given interval
  -query-stale
    	Run stale blocking queries
  -query-wait duration
    	Bloquing queries max wait time (default 10m0s)
  -register int
    	Register N -service instances
  -rpc
    	Use RPC server calls instead of agent HTTP
  -rpc-addr string
    	When using rpc, the consul rpc addr (default "127.0.0.1:8300")
  -service string
    	Service to watch (default "srv")
  -tags string
    	Comma seperated list of tags to add to registered services (default "", -tags load-test,monitor=false)
  -token string
    	ACL token
  -watchers int
    	Number of concurrnet watchers on service (default 1)

consul-bench's People

Contributors

bcho avatar codyja avatar pierresouchay avatar shimmerglass 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.