Repo test and make demos for various performance tests and strategies.
- Docker Desktop https://docs.docker.com/desktop/
- Go to a terminal window (Windows Terminal etc.)
- git clone https://github.com/olapeter/perf-playground.git
cd perf-playground
docker-compose up --build
(build argument only required when something has changed)- Visit http://127.0.0.1:7777/
- What is a container?
- Is Docker a technology?
- Why not use VMWare, VirtualBox etc.?
- Anatomy of a Dockerfile
- Kubernetes vs. docker-compose
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
- 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) docker-compose up --build
-> This fails- try to understand what is missing
- As a group, try to formulate what docker-compose.yml describes. Bonus point if you can do it one word.
- Be inspired by Dockerfile.server and try to make it work for the storage component
- Repeat
docker-compose up --build
until it works
- Repeat
- Uncomment lines 15 and 16 in Dockerfile.storage (following "# unit tests")
docker-compose up --build
- Oh noes, fails again.- Fix it.
- Page at http://127.0.0.1:7777/ should now be green
- Open "Docker desktop" and stop any of the "perf-playground_*" services
- Observe what happens at http://127.0.0.1:7777/
Switch to a new terminal window and cd into perf-playground
chmod +x runtestk6.sh
(first time only)
./runtestk6.sh 001
- 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) - Find out how to log the HTTP headers of the k6 requests in the test
- Modify the k6 test to add a check for response code 200
- Modify the k6 test to run a total of 50 requests in 10 seconds
- Modify the k6 test to add a threshold for response time
- Modify the k6 test to log in a user in a setup function, then access an authenticated endpoint in the main test
https://en.wikipedia.org/wiki/Mob_programming https://codefresh.io/containers/docker-anti-patterns/ https://docs.docker.com/develop/develop-images/multistage-build/
https://codefresh.io/kubernetes-tutorial/kubernetes-antipatterns-1/