Giter Club home page Giter Club logo

haproxy-hc-cpu-load-poc's Introduction

haproxy-hc-cpu-load-poc

This is a PoC showing that a backend server with a L4 health check causes high CPU load when down compared to a backend server with no health check. We can reproduce that by starting two Vagrant VMs, install HaProxy, block the backend server IP via iptables and deploy a nearly identical config. The only difference is the check parameter on the server.

Quickstart

Install Vagrant and VirtualBox and run

vagrant up

Afterwards you have the high CPU load example on port 8080 and the low CPU load example on port 8081. You can find the status page on both ports on /stats.

Next log into the machines and start htop to monitor CPU load:

vagrant ssh haproxy-high-cpu
sudo htop
vagrant ssh haproxy-low-cpu
sudo htop

Next you can start to put some load on the example instances. In this case we use the tool wrk but any load testing tool should be fine.

watch wrk http://<host-ip>:8080 -c 100 -t 4 -d 120
watch wrk http://<host-ip>:8081 -c 100 -t 4 -d 120

It is recommended to do this from another machine since wrk uses a lot of CPU itself.

Now you should be able to see that the high CPU load example indeed uses a lot more CPU than the other one. The only difference is the check parameter on the backend's server. You can find the config files at the root of this repo.

haproxy-hc-cpu-load-poc's People

Contributors

phihos avatar

Watchers

 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.