From a2fbd32ad6d0752b838f047ee0c4c188e22b71cb Mon Sep 17 00:00:00 2001 From: Lawrence Date: Tue, 14 Nov 2017 12:49:40 +0000 Subject: [PATCH] Continued work on Load testing #11 --- .../loadtest/WebServicePkg/ServiceManifest.xml | 6 ++++-- Testing/Cleanup.sh | 7 +++++++ Testing/Scenario1/Setup.sh | 6 +++--- Testing/Scenario2/Setup.sh | 16 ++++++++++++++++ .../TraefikPkg/Code/traefik.toml | 9 +++++++++ 5 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 Testing/Cleanup.sh create mode 100755 Testing/Scenario2/Setup.sh diff --git a/Demos/apps/loadtest/WebServicePkg/ServiceManifest.xml b/Demos/apps/loadtest/WebServicePkg/ServiceManifest.xml index 4aaeee3..2277b84 100644 --- a/Demos/apps/loadtest/WebServicePkg/ServiceManifest.xml +++ b/Demos/apps/loadtest/WebServicePkg/ServiceManifest.xml @@ -5,7 +5,9 @@ - + + + @@ -23,7 +25,7 @@ - + diff --git a/Testing/Cleanup.sh b/Testing/Cleanup.sh new file mode 100644 index 0000000..9c56c2e --- /dev/null +++ b/Testing/Cleanup.sh @@ -0,0 +1,7 @@ +sfctl application list --query items[].id -o tsv | grep node | xargs -n 1 -P 12 sfctl application delete --application-id +sfctl application unprovision --application-type-name NodeAppType --application-type-version 1.0.0 +sfctl store delete --content-path loadtest + +sfctl application delete --application-id traefik +sfctl application unprovision --application-type-name TraefikType --application-type-version 1.0.0 +sfctl store delete --content-path ApplicationPackageRoot \ No newline at end of file diff --git a/Testing/Scenario1/Setup.sh b/Testing/Scenario1/Setup.sh index b733fea..72ca701 100755 --- a/Testing/Scenario1/Setup.sh +++ b/Testing/Scenario1/Setup.sh @@ -5,9 +5,9 @@ sfctl application create --app-type TraefikType --app-version 1.0.0 --app-name f sfctl application upload --path ./Demos/apps/loadtest -sfctl application provision --application-type-build-path ./loadtest -for i in {30..300} +sfctl application provision --application-type-build-path loadtest +for i in {348..500} do ( echo "Deploying instance $i" - sfctl application create --app-type NodeAppType --app-version 1.0.0 --parameters "{\"PORT\":\"90$i\"}" --app-name fabric:/node$i ) & + sfctl application create --app-type NodeAppType --app-version 1.0.0 --parameters "{\"PORT\":\"25$i\"}" --app-name fabric:/node25$i ) & done \ No newline at end of file diff --git a/Testing/Scenario2/Setup.sh b/Testing/Scenario2/Setup.sh new file mode 100755 index 0000000..adebb04 --- /dev/null +++ b/Testing/Scenario2/Setup.sh @@ -0,0 +1,16 @@ +#Traefik install +sfctl application upload --path ./Traefik/ApplicationPackageRoot/ +sfctl application provision --application-type-build-path ApplicationPackageRoot +sfctl application create --app-type TraefikType --app-version 1.0.0 --app-name fabric:/traefik + +#Spin up some node apps +sfctl application upload --path ./Demos/apps/loadtest +sfctl application provision --application-type-build-path loadtest +for i in {100..120} +do + ( echo "Deploying instance $i" + sfctl application create --app-type NodeAppType --app-version 1.0.0 --parameters "{\"PORT\":\"25$i\", \"RESPONSE\":\"25$i\"}" --app-name fabric:/node25$i ) & +done + + +#Run load test diff --git a/Traefik/ApplicationPackageRoot/TraefikPkg/Code/traefik.toml b/Traefik/ApplicationPackageRoot/TraefikPkg/Code/traefik.toml index c4e5341..fdb02cc 100644 --- a/Traefik/ApplicationPackageRoot/TraefikPkg/Code/traefik.toml +++ b/Traefik/ApplicationPackageRoot/TraefikPkg/Code/traefik.toml @@ -75,6 +75,15 @@ address = ":80" # address = ":9000" +# To enable Traefik to export internal metrics to Prometheus +[web.metrics.prometheus] + +# Buckets for latency metrics +# +# Optional +# Default: [0.1, 0.3, 1.2, 5] +buckets=[0.1,0.3,1.2,5.0] + ################################################################ # Service Fabric provider ################################################################