Coder Social home page Coder Social logo

locust-openfaas's Introduction

locust-openfaas

Run the locust.io load-testing tool on OpenFaaS with Kubernetes, Docker Swarm, Nomad, DC/OS or Rancher Cattle.

This sample function shows how to run a load-test with the locust tool. OpenFaaS is Making Serverless Functions Simple.

What is Locust?

Locust is an easy-to-use, distributed, user load testing tool. It is intended for load-testing web sites (or other systems) and figuring out how many concurrent users a system can handle. The idea is that during a test, a swarm of locusts will attack your website. The behavior of each locust (or test user if you will) is defined by you and the swarming process is monitored from a web UI in real-time. This will help you battle test and identify bottlenecks in your code before letting real users in.

How do you use it with OpenFaaS?

Pre-reqs:

  • Install Docker
  • Deploy OpenFaaS and extend the built-in timeouts
  • Install faas-cli
  • Clone the GitHub repo

Usage

This example function shows that it's possible to run a locust load-test through OpenFaaS.

Usage:

$ faas-cli build
$ faas-cli deploy
$ echo -n https://requestb.in/uhphaiuh | \
  faas-cli invoke locust > results.csv && \
  cat results.csv

This will take several seconds to build up to the full load and will return the whole output to your client when done as a CSV result file in plain-text.

"Method","Name","# requests","# failures","Median response time","Average response time","Min response time","Max response time","Average Content Size","Requests/s"
"GET","/uhphaiuh",1099,0,340,702,141,5702,2,213.43
"None","Total",1099,0,340,702,141,5702,2,213.43

You will also need to up the timeouts on your OpenFaaS gateway.

locust-openfaas's People

Contributors

alexellis avatar

Stargazers

Diman ZT avatar Cagri Tasci avatar Dmitry Kozlov avatar  avatar Johnny Mkhael avatar Chew Chit Siang avatar Hien Phan avatar ChanYub Park avatar  avatar

Watchers

James Cloos avatar  avatar Diman ZT avatar  avatar

Forkers

hien dimanzt

locust-openfaas's Issues

Open file limit

Locust likes to open alot of files while running, however the limit is set to 1024.

How do we increase the open file limit for this openfaas function?

Increasing the open file limit on the whole system does not seem to work.

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.