Giter Club home page Giter Club logo

blitzy's Introduction

Blitzy - A simple HTTP load tester in Elixir

Inspired by this post by Victor Martinez of WatchSumo.

% ./blitzy -n 100 http://www.bieberfever.com

Distributed Blitzy

It is way more fun to start distributed. Edit the provided config/config.exs with whatever node name suits your fancy. This is optional, and you can stick to the provided one.

config :blitz, master_node: :"[email protected]"

config :blitz, slave_nodes: [:"[email protected]", 
                             :"[email protected]",
                             :"[email protected]"] 

Here, the master node is :[email protected]; the rest are slave nodes.

Start up a couple of nodes, and name them accordingly. For example, here's how to start one of them:

% iex --name [email protected] -S mix

Now, when you run the the command

% ./blitzy -n 100 http://www.bieberfever.com

the requests will be split across the number of nodes you created, including the master node. Here's an example run:

17:03:30.600 [info]  worker [[email protected]] completed in 5451.854 msecs

17:03:30.600 [info]  worker [[email protected]] completed in 5258.639999999999 msecs

17:03:30.600 [info]  worker [[email protected]] completed in 5272.281 msecs

17:03:30.600 [info]  worker [[email protected]] completed in 5452.012 msecs

17:03:30.600 [info]  worker [[email protected]] completed in 5258.318 msecs

17:03:30.600 [info]  worker [[email protected]] completed in 5300.413 msecs
...
17:03:31.023 [info]  worker [[email protected]] completed in 5653.303 msecs
  Succeeded         : 50
  Failures          : 0
  Total time (msecs): 542665.9879999999
  Avg time   (msecs): 1629.6275915915912


17:03:31.024 [info]  worker [[email protected]] completed in 5609.749 msecs
  Succeeded         : 50 
  Failures          : 0
  Total time (msecs): 485414.8010000001
  Avg time   (msecs): 1457.7021051051054

Building the Executable

mix escript.build

blitzy's People

Contributors

benjamintanweihao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blitzy's Issues

Multi-node fails

Downloaded, compiled, compile failed as the old timex does not work on modern elixir, updated timex and the escript runs properly. Spooled up nodes b/c/d and run it again and it crashes after a few seconds with:

10:23:11.685 [info]  Pummelling http://test_server01/ with 400000 requests
** (MatchError) no match of right hand side value: {:error, {:EXIT, {:undef, [{Task.Supervised, :start_link, [#PID<0.69.0>, {:"[email protected]", #PID<0.69.0>}, {Blitzy.Worker, :start, ["http://test_server01/"]}], []}, {:supervisor, :do_start_child_i, 3, [file: 'supervisor.erl', line: 374]}, {:supervisor, :handle_call, 3, [file: 'supervisor.erl', line: 399]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 629]}, {:gen_server, :handle_msg, 5, [file: 'gen_server.erl', line: 661]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}}}
    (elixir) lib/task/supervisor.ex:67: Task.Supervisor.async/4
    (elixir) lib/enum.ex:1047: anonymous fn/3 in Enum.map/2
    (elixir) lib/enum.ex:1390: anonymous fn/3 in Enum.reduce/3
    (elixir) lib/range.ex:69: Enumerable.Range.reduce/5
    (elixir) lib/enum.ex:1389: Enum.reduce/3
    (elixir) lib/enum.ex:1047: Enum.map/2
    (elixir) lib/enum.ex:836: anonymous fn/3 in Enum.flat_map/2
    (elixir) lib/enum.ex:1385: Enum."-reduce/3-lists^foldl/2-0-"/3

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.