Skip to content
This repository has been archived by the owner on Jul 16, 2019. It is now read-only.

Commit

Permalink
Initial perf test #11
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrencegripper committed Nov 13, 2017
1 parent 66723ec commit bfdd3a6
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 2 deletions.
27 changes: 27 additions & 0 deletions Demos/apps/loadtest/ApplicationManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="NodeAppType" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="Port" DefaultValue="" />
<Parameter Name="Response" DefaultValue="" />
</Parameters>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="WebServicePkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<ResourceOverrides>
<Endpoints>
<Endpoint Name="NodeAppTypeEndpoint" Port="[Port]" />
</Endpoints>
</ResourceOverrides>
<EnvironmentOverrides CodePackageRef="Code">
<EnvironmentVariable Name="NODE_PORT" Value="[Port]" />
<EnvironmentVariable Name="RES_STRING" Value="[Response]" />
</EnvironmentOverrides>
</ServiceManifestImport>
<DefaultServices>
<Service Name="WebService" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="WebServicePkg" InstanceCount="-1">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
</ApplicationManifest>
Binary file added Demos/apps/loadtest/WebServicePkg/Code/node.exe
Binary file not shown.
15 changes: 15 additions & 0 deletions Demos/apps/loadtest/WebServicePkg/Code/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var http = require('http');

const PORT = process.env.NODE_PORT || 3000;
const RESPONSE = process.env.RES_STRING || "Hello World"

var server = http.createServer(function (req, res) {
var body = RESPONSE;
var content_length = body.length;
res.writeHead(200, {
'Content-Length': content_length,
'Content-Type': 'text/plain' });
res.end(body);
});
server.listen(PORT);
console.log('Server is running on port ' + PORT);
34 changes: 34 additions & 0 deletions Demos/apps/loadtest/WebServicePkg/ServiceManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="WebServicePkg" Version="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<ServiceTypes>
<StatelessServiceType ServiceTypeName="WebServicePkg" UseImplicitHost="true">
<Extensions>
<Extension Name="Traefik">
<Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
<Label Key="traefik.frontend.rule.default">PathPrefixStrip: /v1</Label>
<Label Key="traefik.expose">true</Label>
</Labels>
</Extension>
</Extensions>
</StatelessServiceType>
</ServiceTypes>
<CodePackage Name="code" Version="1.0.0">
<EntryPoint>
<ExeHost>
<Program>node.exe</Program>
<Arguments>server.js</Arguments>
<WorkingFolder>CodeBase</WorkingFolder>
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048"/>
</ExeHost>
</EntryPoint>
<EnvironmentVariables>
<EnvironmentVariable Name="NODE_PORT" Value="[Port]"/>
<EnvironmentVariable Name="RES_STRING" Value="Hello World"/>
</EnvironmentVariables>
</CodePackage>
<Resources>
<Endpoints>
<Endpoint Name="NodeAppTypeEndpoint" Port="3000" UriScheme="http"/>
</Endpoints>
</Resources>
</ServiceManifest>
13 changes: 13 additions & 0 deletions Testing/Scenario1/Setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#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


sfctl application upload --path ./Demos/apps/loadtest
sfctl application provision --application-type-build-path ./loadtest
for i in {30..300}
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 ) &
done
16 changes: 16 additions & 0 deletions Testing/Scenarios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## What are the Scenarios we're testing?

# Scenario 1 - Large number of Apps/Services in Cluster

When Traefik is running in a cluster with a large number of Apps and Services does it function correctly. Capture the following metrics with a low and a high number of apps and compare the difference.

Metrics - the time take for:
- A property override to become effective
- An added service to become routable
- Provider update to take place

# Scenario 2 - Large number of requests

When Traefik is hit with large volumes of traffic does it handle them well?

TBD
4 changes: 2 additions & 2 deletions Traefik/ApplicationPackageRoot/TraefikPkg/Code/traefik.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ clustermanagementurl = "https://localhost:19080"
apiversion = "3.0"

# Client certifcate file path
clientcertfilepath = "certs/client.crt"
clientcertfilepath = "certs/clientkey.cer"

# Client certifcate key file path
clientcertkeyfilepath = "certs/client.key"
clientcertkeyfilepath = "certs/clientkey.key"

# Skip TLS verify
InsecureSkipVerify=true

0 comments on commit bfdd3a6

Please sign in to comment.