Code Monkey home page Code Monkey logo

distgatling's Introduction

About Gatling Build Status

Gatling is a highly capable load testing tool. It is designed for ease of use, maintainability and high performance.

Out of the box, Gatling comes with excellent support of the HTTP protocol that makes it a tool of choice for load testing any HTTP server. As the core engine is actually protocol agnostic, it is perfectly possible to implement support for other protocols. For example, Gatling currently also ships JMS support.

The Quickstart has an overview of the most important concepts, walking you through the setup of a simple scenario for load testing an HTTP server.

Having scenarios that are defined in code and are resource efficient are the two requirements that motivated the development of Gatling. Based on an expressive DSL, the scenarios are self explanatory. They are easy to maintain and can be kept in a version control system.

Gatling’s architecture is asynchronous as long as the underlying protocol, such as HTTP, can be implemented in a non blocking way. This kind of architecture lets us implement virtual users as messages instead of dedicated threads, making them very resource cheap. Thus, running thousands of concurrent virtual users is not an issue tool.

Scaling Out

Sometimes, generating some very heavy load from a single machine might lead to saturating the OS or the network interface controller.

In this case, you might want to use several Gatling instances hosted on multiple machines.

Gatling doesn’t have a cluster mode yet, hence the need for this project.

Distributed Gatling (DistGatling)

Distributed Gatling is a solution that was created to enable developers and QA engineers to run gatling simulation tests in a distributed/cluster environment.
The solution is cloud native and has two components, Cluster Master and Cluster Worker.

 The overview section displays information about partition status across the cluster,worker task slots distribution by host and task slot distribution by partition

Alt text


Cluster Master (CM)

The Cluster Master provides users interfaces and REST API's for basic operation related to running , tracking and consolidating performance reports, Master is also responsible for

- Handling user request
- Tracking and monitoring the health of Cluster Workers 
- Submitting Gatling simulation tasks to distributed workers
- Tracking the progress of distributed tasks
- Collecting and Aggregating performance reports
- Providing a system of records for  multiple simulation history
- Maintaining repository for simulation and resource files

Different projects could share the same cluster and run side by side on the same cluster with complete isolation

Cluster Worker(CW)

After joining the cluster, CW workers are responsible for - Running performance tests - Pulling Simulation and resource files from the master - Proving a streaming REST end points for error logs, std logs and simulation logs

Usage

Download Gatling bundle as a .zip file here. Unzip the file in a directory of your choosing. Add a cancel.sh command in the bin directory, suitable for your system, that stops the gatling processes on the workers (example: ps ax | grep "uploads$1" | grep -v grep | awk '{print $1}' | xargs kill -9 )

After cloning or downloading the repository of distGatling ,follow the following steps to start the cluster

1. Update the application.yml file settings (gatling-rest and gatling-agent)

# User account for connect to gatling-rest UI
security:
    username: "gatling"
    password: "gatling"

job:
  path: "/workspace/gatling-charts-highcharts-bundle-2.1.7" # Path to the base directory where the gatling lib, simulation, resource and conf are stored
  logDirectory: "/workspace/gatling-charts-highcharts-bundle-2.1.7/" # Base directory for log files(log/error and log/std)
  command: "/bin/bash" # Base command to run gatling.sh file
  artifact: "/workspace/gatling-charts-highcharts-bundle-2.1.7/bin/{0}.sh" # Path for the location of gatling.sh
  jobDirectory: /workspace/gspace/ # directory to store artifacts temporarily, only applicable for agents

2. Open terminal window and run 

 mvn clean package

3. Locate the master shell script(under gatling-rest) and run master.sh to start the Cluster Master, take a note of the master ip and port
    
    /bin/bash master.sh -Dmaster.port=<2551> -Dserver.port=<8080>

After starting the master using the above command, point your browser to GET http://localhost:8080/ to access the web page.

4. Locate the agent shell script(under gatling-agent) and run agent.sh to start the Cluster worker on each node you intend to include in the cluster, each worker should be assigned the correct master contact point
    
    /bin/bash agent.sh -Dakka.contact-points=<MASTER_HOST>:<MASTER_PORT> -Dactor.port=<0> -Dserver.port=<8090>

Goal

The design of distributed gatling is based on Derek Wyatt's blog on Work pulling pattern and has the following goals:

- Provide a mechanism for the master to detect death of workers and reassign work if need be
- Dynamic workers to allow for auto scaling, up/down
- Message that is delivered to Master is durable

Multiple teams across your enterprise can share the same cluster, each worker/agent is given a role name via actor.role config property or -Dactor.role parameter. When you submit a distributed simulation task you must provide a valid worker role, this allows the system to run the simulation task on the pool of workers labeled with the same role name. We recommend labeling all your workers with the same name initially and resort to partitioning your workers only when multiple teams start stepping on each other foot.

Alt text

Workers pull instructions from the master, the master keeps track of which instruction is consumed by which worker. The instructions could assume one of the following forms:

- FileRequest
- WorkRequest
- AbortRequest
- RegisterRequest

The master does not actively assign instructions to any worker but instead workers pull the next task when they are idle. If a worker is busy it will not be issued a new task. Once the master assigns simulation task to a worker, workers are required to report task progress to master every predefined time interval. If the master does not receive a progress heart beat for simulation task, it assumes the worker is dead and reassigns the task to a different worker. In addition to marking the worker as dead and the job as failed, the master also removes the worker from the active list of workers. If the worker become alive after recovery it should re-join the cluster and re-register with the master.

Screen Shots


Start a distributed simulation task - users provide the worker pool to use, the simulation file to run and number of parallel tasks

Alt text NB: The bodies input wait a zip containing resource files used for your test


Track the progress of a distributed simulation task on the cluster, after all the distributed tasks complete a button will appear on this page to allow you generate and view the gatling report

Alt text


Generate a report - collects all simulation log and generates a gatling performance report

Alt text


Login screen

Alt text


Cluster information - shows current state of all the workers in the cluster

Alt text

Running a simulation that is packaged into an uber jar is now supported via gatling-client(https://github.com/Abiy/distGatlingClient)

Update config.yml with the necessary configuration

Use the following command to submit your uber jar to cluster

/bin/bash dist-gatling-client.sh  -Dclient.userName=user -Dclient.parallelism=1

Build Status

distgatling's People

Contributors

abiy avatar alagrede avatar bekreth avatar silviuvergoti avatar svergoti 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

distgatling's Issues

Add support for Uber-Jar to the website UI

Currently, If someone wants to use a JAR file to run their load tests, they need to use the DistGatling Client. It would be great to allow for the web UI to permit the upload of a JAR file.

Expand out URL for job details when submitted via client

Currently, the last output from the distGatlingClient prior to exiting is to provide the following log line.
Job submitted. tracking info =>#detail/f1ce22b2-70af-442a-803d-d67226004bd5
As a small feature, it'd be nice if the host and port were pulled from the config.yml in order to fully populate this tracking page.

User defined Simulation class could not be loaded

I get the following error after i submit a simulation class. Could you please advice ?

Exception in thread "main" java.lang.IllegalArgumentException: User defined Simulation class com.alh.store.gatling.simulation.BasicSimulation could not be loaded at io.gatling.app.Selection$Selector.findUserDefinedSimulationInClassloader$1(Selection.scala:80) at io.gatling.app.Selection$Selector.$anonfun$singleSimulationFromConfig$4(Selection.scala:85) at scala.Option.orElse(Option.scala:447) at io.gatling.app.Selection$Selector.$anonfun$singleSimulationFromConfig$3(Selection.scala:85) at scala.Option.flatMap(Option.scala:271) at io.gatling.app.Selection$Selector.singleSimulationFromConfig(Selection.scala:83) at io.gatling.app.Selection$Selector.$anonfun$selection$1(Selection.scala:52) at scala.Option.getOrElse(Option.scala:189) at io.gatling.app.Selection$Selector.selection(Selection.scala:44) at io.gatling.app.Selection$.apply(Selection.scala:36) at io.gatling.app.Runner.run0(Runner.scala:73) at io.gatling.app.Runner.run(Runner.scala:60) at io.gatling.app.Gatling$.start(Gatling.scala:80) at io.gatling.app.Gatling$.fromArgs(Gatling.scala:46) at io.gatling.app.Gatling$.main(Gatling.scala:38) at io.gatling.app.Gatling.main(Gatling.scala)Caused by: java.lang.ClassNotFoundException: com.alh.store.gatling.simulation.BasicSimulation at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at io.gatling.app.Selection$Selector.$anonfun$singleSimulationFromConfig$2(Selection.scala:71) at scala.util.Try$.apply(Try.scala:213) at io.gatling.app.Selection$Selector.findUserDefinedSimulationInClassloader$1(Selection.scala:71) ... 15 more[]

image

Connection timeout in Worker

Master works fine. When I run the agent.sh, I am getting the below error

Message [akka.actor.Status$Failure] from Actor[akka://PerformanceSystem/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FPerformanceSystem%40***...%3A2551-1#1419370574] to Actor[akka://PerformanceSystem/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FPerformanceSystem%40...%3A2551-1#1419370574] was not delivered. [8] dead letters encountered. If this is not an expected behavior, then [Actor[akka://PerformanceSystem/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FPerformanceSystem%40...%3A2551-1#1419370574]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
2021-11-21 06:26:31.049 WARN 5035 --- [lt-dispatcher-5] a.remote.transport.netty.NettyTransport : Remote connection to [null] failed with org.jboss.netty.channel.ConnectTimeoutException: connection timed out: /
...***:2551
2021-11-21 06:26:33.820 INFO 5035 --- [lt-dispatcher-4] ctorRefProvider$RemoteDeadLetterActorRef : Message [akka.cluster.client.ClusterReceptionist$Internal$GetContacts$] from Actor[akka://PerformanceSystem/user/clusterClient#2136760599] to Actor[akka://PerformanceSystem/deadLetters] was not delivered. [9] dead letters encountered. If this is not an expected behavior, then [Actor[akka://PerformanceSystem/deadLetters]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.

This sis the command

/bin/bash agent.sh -Dakka.contact-points=:2551 -Dactor.port=2558 -Dserver.port=8090

Could you please help?

build flag to specify use of index_local.html and locally pulled npm_modules

It would be nice to build gatling-rest in such a way that we can do npm install, pull required modules and package that into JAR rather than dynamically loading from the web. In this way we can provide immutable artifact which always would work in the same way. That would help to avoid situations when downstream repos are down, or latest version of module ports to alpha version (like https://unpkg.com/rxjs -> https://unpkg.com/[email protected])

Support for kubernetes worker deployments

Any plans to support Kubernetes as a platform for deploying workers? I was thinking to contribute maybe to the project and provide possibility for dist gaitling to support Kubernetes to ramp-up workers on demand.

Prevent a job from kicking off if the JAR upload failed

If there is a failure in trying to load a JAR to the distGatling cluster via the shell script, the script still attempts to run the jar even though it doesn't exist. Relatedly, failures to upload a jar should output a useful log message instead of a stacktrace.

Expose error log for failed runs

Currently, if a job fails, the website provides no further information as to why. There should be a mechanism to expose the logs of the failed run to allow for preliminary debugging instead of having to ssh into the box for solutions.

support for coursier

https://github.com/coursier/coursier is a tool for resolving the transitive dependencies for a maven / ivy artifact. It would be good to support an artefact name (then resolve it) instead of requiring an uber jar... it can be very difficult to publish uber jars in many organisations.

Add feature to schedule load tests

Frequently, resources are in period of contention requiring load tests to run in off peak hours. Allowing for a job to be submitted in the future would allow for people to setup load tests to run over night, or, if exhaustive testing is being down with a variety of configurations, sequence a set of load tests to be run over the course of several hours.

Unable to build inside container

Hi,
i tried building your project inside a container to have a final slim master and worker container.
mvn clean package fails when executing test

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [akka.actor.ActorSystem]: Factory method 'createActorSystemWithMaster' threw exception; nested exception is java.lang.ClassNotFoundException: javafx.util.Pair at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)

do you have any advise?

Running inside Docker container

I've created Docker containers for the rest master and the agent. They can communicate but the rest master always seems to bind to the 172 Docker address, but the traffic is coming in on the 10, address and so the . This leads to the following error. Is there any configuration I can change to allow this agent to connect please?

2020-03-04 12:04:02.427 ERROR 9 --- [lt-dispatcher-2] akka.remote.EndpointWriter : dropping message [class akka.actor.ActorSelectionMessage] for non-local recipient [Actor[akka.tcp://[email protected]:2551/]] arriving at [akka.tcp://[email protected]:2551] inbound addresses are [akka.tcp://[email protected]:2551]

Update documentation on how to access standard metrics

Add a ReST path that outputs the following information from a given build number

Counts:
Total
OK
KO
KO%
Req/s

Response:
Min
50th Percentile
75th Percentile
95th Percentile
99the Percentile
Max
Mean
Std. Deviation

Error on opening start page in browser after starting the master.sh

  1. Run
    /bin/bash master.sh -Dmaster.port=<2551> -Dserver.port=<8080>
  2. Open browser to GET http://localhost:8080/ to access the web page

Page not loading and error appears in browser console:

Error ​ columnNumber: 0 ​ fileName: "https://unpkg.com/[email protected]/dist/system.src.js" ​ lineNumber: 1460 ​ message: "Fetch error: 404 Not Found\n Instantiating https://unpkg.com/[email protected]/operators.js\n Loading https://unpkg.com/@angular/core/bundles/core.umd.js\n Loading http://localhost:8080/app/main.js\n Loading app" ​ originalErr: Error ​​ columnNumber: 13 ​​ fileName: "https://unpkg.com/[email protected]/dist/system.src.js" ​​ lineNumber: 1460 ​​ message: "Fetch error: 404 Not Found" ​​ stack: "fetchFetch/<@https://unpkg.com/[email protected]/dist/system.src.js:1460:13\nZoneDelegate.prototype.invoke@https://unpkg.com/zone.js/dist/zone.js:388:17\nZone.prototype.run@https://unpkg.com/zone.js/dist/zone.js:138:24\nscheduleResolveOrReject/<@https://unpkg.com/zone.js/dist/zone.js:872:29\nZoneDelegate.prototype.invokeTask@https://unpkg.com/zone.js/dist/zone.js:421:17\nZone.prototype.runTask@https://unpkg.com/zone.js/dist/zone.js:188:28\ndrainMicroTaskQueue@https://unpkg.com/zone.js/dist/zone.js:595:25\nn@https://unpkg.com/core-js/client/shim.min.js:8:31509\nR/<@https://unpkg.com/core-js/client/shim.min.js:8:31654\nt@https://unpkg.com/core-js/client/shim.min.js:7:26035\n" ​​ __proto__: Object { … } ​ stack: "fetchFetch/<@https://unpkg.com/[email protected]/dist/system.src.js:1460:13\nZoneDelegate.prototype.invoke@https://unpkg.com/zone.js/dist/zone.js:388:17\nZone.prototype.run@https://unpkg.com/zone.js/dist/zone.js:138:24\nscheduleResolveOrReject/<@https://unpkg.com/zone.js/dist/zone.js:872:29\nZoneDelegate.prototype.invokeTask@https://unpkg.com/zone.js/dist/zone.js:421:17\nZone.prototype.runTask@https://unpkg.com/zone.js/dist/zone.js:188:28\ndrainMicroTaskQueue@https://unpkg.com/zone.js/dist/zone.js:595:25\nn@https://unpkg.com/core-js/client/shim.min.js:8:31509\nR/<@https://unpkg.com/core-js/client/shim.min.js:8:31654\nt@https://unpkg.com/core-js/client/shim.min.js:7:26035\n" ​ __proto__: {…} ​​ constructor: function Error() ​​ message: "" ​​ name: "Error" ​​ stack: Getter & Setter ​​ toSource: function toSource() ​​ toString: function toString() ​​ __proto__: Object { … }

Allow for slim jars to be uploaded

Currently, in order to submit a job as a JAR file, it requires to user to package the jar with all of its dependencies which leads to JAR files starting a 40MB because they have to package Scala and Gatling in them. Given that these are consistent dependencies in every JAR file, we should allow for the config.yml to specify what versions of these people are using and merge them with the JAR that is uploaded to decrease the network load required to setup a job.

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.