This repo should provide an easy way to check different programming languages for their performance. To make this comparable all of them have to implement the same rest api. Description see below.
All the different services will be deployed to our local k8s with limited resources.
If they are deployed successfully some basic api tests will be executed and afterwards load test will be executed to the rest api.
To provide an kubernetes this repo uses the kubernetes playground project https://github.com/pipiobjo/k8s-playground
-
Create a new folder for your service
-
Follow the pattern [language]-[framework]-[additional-identifiers]
-
For example java-pure-tomcat or java-springboot-jetty
-
-
-
Place your build script in the build-scripts folder
-
Use java-pure-build-deploy.sh as template
-
-
K8s manifests are generated via kustomize
-
The scripts expecting a k8s folder with a kustomization.tpl.yaml
-
This file is used to update the docker image version and is then copied to kustomization.yaml
-
The kustomization.yaml file is deleted after build to keep the git repo clean
-
Please use myapp as image name in your kustomize deployment resource this will automatically be replaced with the real image name
-
-
-
Add starting load test script for your service
-
Use java-pure-load-tests.sh as sample
-
load test reports should be placed in load-test-reports
-
-
if everything is working please create an PR for the repo
if you want to copy and existing k8s config consider using
grep -rl oldserviceName . | xargs sed -i 's/oldserviceName/newserviceName/g'
grep -rl java-pure . | xargs sed -i 's/java-pure/golang-chi/g'
The provided load test scripts using k6s https://k6.io/docs/
curl -s localhost:8080/api/user | jq
[]
curl -s --header "Content-Type: application/json" \
--request POST \
--data '{"login":"xyz","password":"xyz","firstname":"john", "lastname":"smith"}' \
http://localhost:8080/api/user | jq
{
"id": "12395c7b-d545-4fb8-90ea-bd37e73310b7"
}
curl -v --header "Content-Type: application/json" \
--request POST \
--data '{"login":"xyz","password":"xyz", "firstname":"john", "lastname":"smith"}' \
http://localhost:8080/api/user | jq
< HTTP/1.1 400 Bad Request
< Date: Wed, 02 Nov 2022 23:06:26 GMT
< Transfer-encoding: chunked
< Content-type: application/json
"user already exists"
curl -v --header "Content-Type: application/json" \
--request POST \
--data '{"login":"abc","password":"abc","firstname":"john", "lastname":"do"}' \
http://localhost:8080/api/user | jq
curl -s http://localhost:8080/api/user | jq
[
{
"login": "abc",
"firstName": "john",
"lastName": "do"
},
{
"login": "xyz",
"firstName": "john",
"lastName": "smith"
}
]
curl -s http://localhost:8080/api/user\?login\=abc | jq
[
{
"login": "abc",
"firstName": "john",
"lastName": "do"
}
]
curl -s http://abc:abc@localhost:8080/api/greeting | jq
{
"msg": "Hello john do!",
"firstname": "john",
"lastname": "do"
}