Skip to content

olapeter/perf-playground

Repository files navigation

perf-playground

Repo test and make demos for various performance tests and strategies.

Prerequisites

  1. Docker Desktop https://docs.docker.com/desktop/

How to get started

  1. Go to a terminal window (Windows Terminal etc.)
  2. git clone https://github.com/olapeter/perf-playground.git
  3. cd perf-playground
  4. docker-compose up --build (build argument only required when something has changed)
  5. Visit http://127.0.0.1:7777/

Container workshop

Learning objectives

  1. What is a container?
  2. Is Docker a technology?
  3. Why not use VMWare, VirtualBox etc.?
  4. Anatomy of a Dockerfile
  5. Kubernetes vs. docker-compose

Initial state

Page at http://127.0.0.1:7777/ should show some red error. We want to make it green.

To do that we need to containerize our storage module

Challenges / tasks container workshop

  1. Locate docker-compose.yml and uncomment the commented lines (hint: type code . in the terminal on Windows/Linux. On Mac start VSCode or similar the usual way)
  2. docker-compose up --build -> This fails
    • try to understand what is missing
  3. As a group, try to formulate what docker-compose.yml describes. Bonus point if you can do it one word.
  4. Be inspired by Dockerfile.server and try to make it work for the storage component
    • Repeat docker-compose up --build until it works
  5. Uncomment lines 15 and 16 in Dockerfile.storage (following "# unit tests")
  6. docker-compose up --build - Oh noes, fails again.
  7. Open "Docker desktop" and stop any of the "perf-playground_*" services

k6 workshop

Run k6 test

Switch to a new terminal window and cd into perf-playground

chmod +x runtestk6.sh (first time only)

./runtestk6.sh 001

Challenges / tasks load test workshop

  1. Locate the logs and look at the output (hint: type code . in the terminal on Windows/Linux. On Mac start VSCode or similar the usual way)
  2. Find out how to log the HTTP headers of the k6 requests in the test
  3. Modify the k6 test to add a check for response code 200
  4. Modify the k6 test to run a total of 50 requests in 10 seconds
  5. Modify the k6 test to add a threshold for response time
  6. Modify the k6 test to log in a user in a setup function, then access an authenticated endpoint in the main test

Documentation

https://k6.io/docs/

Literature

https://en.wikipedia.org/wiki/Mob_programming https://codefresh.io/containers/docker-anti-patterns/ https://docs.docker.com/develop/develop-images/multistage-build/

Level up

https://codefresh.io/kubernetes-tutorial/kubernetes-antipatterns-1/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages