Skip to content

Commit

Permalink
Complete Redis server/client doc (#16)
Browse files Browse the repository at this point in the history
* Fix typo in front page

* up version

* Complete redis tutorial

* Complete redis tutorial
  • Loading branch information
yangpanMS authored Nov 16, 2022
1 parent f9ea862 commit 1a2540c
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ steps:
displayName: 'Build Solutions'

# Build NuGet packages for the services/agents in the repo.
- script: $(Build.SourcesDirectory)\build-packages.cmd 0.0.3
- script: $(Build.SourcesDirectory)\build-packages.cmd 0.0.4
displayName: 'Build NuGet Packages'

- task: EsrpCodeSigning@1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ The platform additionally provides the ability to capture important performance

- VirtualClient NuGet Package is at https://www.nuget.org/packages/VirtualClient
```powershell
PM> NuGet\Install-Package VirtualClient -Version 0.0.3
PM> NuGet\Install-Package VirtualClient -Version 0.0.4
```
- You could optionally download directly from NuGet https://www.nuget.org/api/v2/package/VirtualClient/0.0.3
- You could optionally download directly from NuGet https://www.nuget.org/api/v2/package/VirtualClient/0.0.4
- VC executable could be find in those paths
```treeview
VirtualClient/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
NuGet package in the /content/linux-x64|linux-arm64/profiles folder.
-->
<LinuxProfiles Include="profiles\GET-STARTED-OPENSSL.json" />
<LinuxProfiles Include="profiles\GET-STARTED-REDIS.json" />
<LinuxProfiles Include="profiles\BOOTSTRAP-DEPENDENCIES.json" />
<LinuxProfiles Include="profiles\PERF-ASPNETBENCH.json" />
<LinuxProfiles Include="profiles\PERF-COMPRESSION.json" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"Description": "Redis Benchmark",
"Parameters": {
},
"Actions": [
{
"Type": "RedisServerExecutor",
"Parameters": {
"Scenario": "RedisServer",
"Role": "Server",
"Port": "6379",
"PackageName": "Redis",
"Bind": 1
}
},
{
"Type": "RedisMemtierClientExecutor",
"Parameters": {
"Scenario": "Memtier_4t_1c",
"Role": "Client",
"Port": "6379",
"PackageName": "Redis",
"NumberOfThreads": "4",
"NumberOfClients": "1",
"NumberOfRuns": "1",
"DurationInSecs": "60",
"PipelineDepth": "32",
"Bind": 1
}
}
],
"Dependencies": [
{
"Type": "LinuxPackageInstallation",
"Parameters": {
"Scenario": "InstallRequiredLinuxPackagesForMemtier",
"Packages-Apt": "build-essential,libevent-dev,pkg-config,zlib1g-dev,libssl-dev,autoconf,automake,libpcre3-dev",
"Packages-Yum": "zlib-devel,pcre-devel,libevent-devel,openssl-devel,git,gcc-c++,make,autoconf,automake",
"Packages-Dnf": "zlib-devel,pcre-devel,libevent-devel,openssl-devel,git,gcc-c++,make,autoconf,automake"
}
},
{
"Type": "LinuxPackageInstallation",
"Parameters": {
"Scenario": "InstallRequiredLinuxPackagesForRedis",
"Packages-Apt": "wget,build-essential,tcl-dev,numactl",
"Packages-Yum": "wget,numactl,tcl-devel",
"Packages-Dnf": "wget,numactl,tcl-devel"
}
},
{
"Type": "GitRepoClone",
"Parameters": {
"Scenario": "CloneMemtierBenchmarkRepo",
"RepoUri": "https://github.com/RedisLabs/memtier_benchmark",
"PackageName": "memtier"
}
},
{
"Type": "RedisInstallation",
"Parameters": {
"Scenario": "InstallRedis",
"Version": "6.2.1",
"PackageName": "redis"
}
},
{
"Type": "MemtierInstallation",
"Parameters": {
"Scenario": "InstallMemtier",
"Version": "1.4.0",
"PackageName": "memtier"
}
},
{
"Type": "ApiServer"
}
]
}
2 changes: 1 addition & 1 deletion upload-packages.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ echo Feed : %FeedUri%
echo:

for %%f in (%PackageDirectory%\*.nupkg) do (
call dotnet nuget push %%f --api-key %~2 --timeout 1200 --source https://api.nuget.org/v3/index.json %~3 && echo: || Goto :Error
call dotnet nuget push %%f --api-key %~2 --timeout 1200 --source https://api.nuget.org/v3/index.json --skip-duplicate %~3 && echo: || Goto :Error
)

Goto :End
Expand Down
4 changes: 3 additions & 1 deletion website/docs/developing/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ This action actually deploys gh-pages branch to GitHub page server.
[![Document Deployment](https://github.com/microsoft/VirtualClient/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/microsoft/VirtualClient/actions/workflows/pages/pages-build-deployment)

## NuGet build
Azure Pipeline: This is still work in progress as we are waiting on internal process on MSFT signing.
Azure Pipeline:

Unfortunately this Azure pipeline will not be public, because it involves Microsoft signing processes. That is also why our pull requests will always require one Microsoft employee to sign off.

[![NuGet Release Status](https://msazure.visualstudio.com/One/_apis/build/status/OneBranch/CRC-AIR-Workloads/microsoft.VirtualClient?branchName=main)](https://msazure.visualstudio.com/One/_build/latest?definitionId=297462&branchName=main)
19 changes: 12 additions & 7 deletions website/docs/guides/1-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@ id: getting-started
sidebar_position: 1
---

# Getting Started
# Getting Started : OpenSSL

In this document, we are going to run a "hello-world" version of VirtualClient: benchmark your system's crypotography performance, with OpenSSL Speed, using SHA256 algorithm.

---

## Installation

Virtual Client is a self-contained .NET application. There is no ""

#### *NuGet package*

- VirtualClient NuGet Package is at https://www.nuget.org/packages/VirtualClient
```powershell
PM> NuGet\Install-Package VirtualClient -Version 0.0.3
PM> NuGet\Install-Package VirtualClient -Version 0.0.4
```
- You could optionally download directly from NuGet https://www.nuget.org/api/v2/package/VirtualClient/0.0.3
- You could optionally download directly from NuGet https://www.nuget.org/api/v2/package/VirtualClient/0.0.4
- The .nupkg NuGet package is just a .zip file, you can unzip with programs like 7zip, or rename .nupkg to .zip and unzip.
- VC executable could be find in those paths
```treeview
VirtualClient/
Expand Down Expand Up @@ -56,8 +59,8 @@ VirtualClient\out\bin\Debug\x64\VirtualClient.Main\net6.0\win-x64\publish\Virtua
```bash
sudo ./VirtualClient --profile=GET-STARTED-OPENSSL.json --profile=MONITORS-NONE.json --iterations=1 --packages=https://virtualclient.blob.core.windows.net/packages
```
- `--profile=GET-STARTED-OPENSSL.json` tells VC to run a stripped down version of OpenSSL benchmark.
- VirtualClient has a default profile, `--profile=MONITORS-NONE.json` overrides that behavior in this one-time run.
- [`--profile=GET-STARTED-OPENSSL.json`](https://github.com/microsoft/VirtualClient/blob/main/src/VirtualClient/VirtualClient.Main/profiles/GET-STARTED-OPENSSL.json) tells VC to run a stripped down version of OpenSSL benchmark. With SHA256 algorithm.
- VirtualClient has a default profile, [`--profile=MONITORS-NONE.json`](https://github.com/microsoft/VirtualClient/blob/main/src/VirtualClient/VirtualClient.Main/profiles/MONITORS-NONE.json) overrides that behavior in this one-time run.
- `--iteration=1` Tells VC to run this profile once. Default behavior is to run profiles repetatively until timeout.
- `--packages=https://virtualclient.blob.core.windows.net/packages` defines the packages store that VC will download OpenSSL binary from. Not every workload needs binary download. You can also use your own binary and package store if desired.

Expand Down Expand Up @@ -104,7 +107,7 @@ from a benchmark run.
"scenarioEndTime": "2022-11-14T07:26:18.2470775Z",
"scenarioName": "OpenSSL Speed",
"scenarioStartTime": "2022-11-14T07:25:18.2251103Z",
"systemInfo": {"etc"},
"systemInfo": ...,
"tags": "CPU,OpenSSL,Cryptography",
"etc": ...
}
Expand All @@ -121,4 +124,6 @@ VC is designed for large scale perf testing. Check [Telemetry](./telemetry/telem
:::

## Congratulations !!
You just benchmarked your system with OpenSSL.
You just benchmarked your system with OpenSSL.

- To benchmark your system's crypotography performance holisticaly, we recommend the full profile for OpenSSL: [`PERF-CPU-OPENSSL.json`](https://github.com/microsoft/VirtualClient/blob/main/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-OPENSSL.json)
106 changes: 90 additions & 16 deletions website/docs/guides/3-server-client/3-server-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ id: server-client
sidebar_position: 3
---

# Run client -> server workloads
# Run client -> server workloads : Redis

In this document, we are going to run a Redis workload, where server and client are on different systems.
In this document, we are going to run a quick round of Redis workload, where server and client are on different systems.

:::info
Redis is a Linux only workload.
:::

## Environment Setup
1. You need two systems that are in the same subnet/internet and able to see each other.
Expand All @@ -31,30 +35,100 @@ In this document, we are going to run a Redis workload, where server and client

:::note
Wonder why not just use a *--serverIpAddress* like other tools? Great question.<br/>
An environment json will give every client download about their role and other clients' roles. This enables VC to do complex multi-role workloads, like NGINX with server, client and reverse proxy.
An environment json will give every client downledge about their role and other clients' roles. This enables VC to do complex multi-role workloads, like NGINX with server, client and reverse proxy.
:::

## Run Redis Benchmark

- Run this command on both server and client
- One benefit of using a EnvironmentLayout file vs. server ipAddress, is that on all VC instances with difference roles, you can use the exact same command.
```bash
sudo ./VirtualClient --clientId=TestClient --profile=PERF-REDIS.json --profile=MONITORS-NONE.json --iterations=1 --packages=https://virtualclient.blob.core.windows.net
/packages --layoutPath=layout.json
```

- (WIP)



:::caution
In this profile, VC will download Redis and install Redis server.<br/>
If prefered, run in a Virtual Machine to avoid those changes to your system.
:::

- Run this command on client
```bash
sudo ./VirtualClient --clientId=TestClient --profile=GET-STARTED-REDIS.json --profile=MONITORS-NONE.json --iterations=1 --packages=https://virtualclient.blob.core.windows.net/packages --layoutPath=layout.json
```
- Run this command on server
```bash
sudo ./VirtualClient --clientId=TestServer --profile=GET-STARTED-REDIS.json --profile=MONITORS-NONE.json --iterations=1 --packages=https://virtualclient.blob.core.windows.net/packages --layoutPath=layout.json
```
- Notice the two commands are exactly the same except the `--clientId`. The clientId is default to the machine name. You don't need to pass in `clientId` if the `name` in layout.json matches your actual machine name.
- `--layoutPath` should point to the layout json file you just created. Relative and absolute paths are both supported.
- The two VC will install Redis on server, Memtier on client, handshake, and then start the benchmarking.
- The benchmark might run for about 10 minutes, get a cup of ☕.
## Read results and logs
- Similar to the previous tutorial, the metric is in file `logs/metrics-20221116.log`.
- VC captures quite a lot of metrics for Redis: [Full Redis Metrics](../../workloads/redis/redis-metrics.md)
- Two most critical metrics for Redis are throughput and P99 latency
- Throughput
```json {16-19}
{
"timestamp": "2022-11-16T05:35:55.2321711+00:00",
"level": "Information",
"message": "RedisMemtier.ScenarioResult",
"agentId": "testclient",
"appVersion": "1.6.0.0",
"clientId": "testclient",
"executionProfileName": "GET-STARTED-REDIS.json",
"executionProfilePath": "/home/azureuser/virtualclient/profiles/GET-STARTED-REDIS.json",
"executionSystem": null,
"experimentId": "5c6d967f-7c84-4d74-9099-65b6f629d61e",
"metadata": {"experimentId":"5c6d967f-7c84-4d74-9099-65b6f629d61e","agentId":"TestClient"},
"metricCategorization": "",
"metricDescription": "",
"metricMetadata": {},
"metricName": "Throughput",
"metricRelativity": "HigherIsBetter",
"metricUnit": "req/sec",
"metricValue": 3551162.35,
"parameters": {"scenario":"Memtier_4t_1c","role":"Client","port":"6379","packageName":"Redis","numberOfThreads":"4","numberOfClients":"1","numberOfRuns":"1","durationInSecs":"60","pipelineDepth":"32","bind":"1","profileIteration":1,"profileIterationStartTime":"2022-11-16T05:30:34.5264899Z"},
"platformArchitecture": "linux-x64",
"scenarioEndTime": "2022-11-16T05:35:55.2210932+00:00",
"scenarioName": "Memtier_4t_1c",
"scenarioStartTime": "2022-11-16T05:31:55.1121065+00:00",
"systemInfo": ...,
"toolName": "RedisMemtier",
"etc": ...
}
```
- P99 latency
```json {16-19}
{
"timestamp": "2022-11-16T05:35:55.2326483+00:00",
"level": "Information",
"message": "RedisMemtier.ScenarioResult",
"agentId": "testclient",
"appVersion": "1.6.0.0",
"clientId": "testclient",
"executionProfileName": "GET-STARTED-REDIS.json",
"executionProfilePath": "/home/azureuser/virtualclient/profiles/GET-STARTED-REDIS.json",
"executionSystem": null,
"experimentId": "5c6d967f-7c84-4d74-9099-65b6f629d61e",
"metadata": {"experimentId":"5c6d967f-7c84-4d74-9099-65b6f629d61e","agentId":"TestClient"},
"metricCategorization": "",
"metricDescription": "",
"metricMetadata": {},
"metricName": "P99lat",
"metricRelativity": "LowerIsBetter",
"metricUnit": "msec",
"metricValue": 0.255,
"parameters": {"scenario":"Memtier_4t_1c","role":"Client","port":"6379","packageName":"Redis","numberOfThreads":"4","numberOfClients":"1","numberOfRuns":"1","durationInSecs":"60","pipelineDepth":"32","bind":"1","profileIteration":1,"profileIterationStartTime":"2022-11-16T05:30:34.5264899Z"},
"platformArchitecture": "linux-x64",
"scenarioEndTime": "2022-11-16T05:35:55.2210932+00:00",
"scenarioName": "Memtier_4t_1c",
"scenarioStartTime": "2022-11-16T05:31:55.1121065+00:00",
"systemInfo": ...,
"toolName": "RedisMemtier",
"etc": ...
}
```
## Congratulations !!
You just ran a multi-role workload and benchmark your system with Redis.
You just ran a multi-role workload and benchmark your system with Redis.
- The profile `GET-STARTED-REDIS` is a highly stripped down version Redis, with just 1 client and 4 threads.
- The regular [`PERF-REDIS.json`](https://github.com/microsoft/VirtualClient/blob/main/src/VirtualClient/VirtualClient.Main/profiles/PERF-REDIS.json) has a diverse combinations of Redis benchmark. We recommend run the full profile to benchmark Redis performance holistically. The full profile might take couple hours.
1 change: 0 additions & 1 deletion website/docs/overview/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ Released
* Please note we will be renaming package to Microsoft.VirtualClient, pending MSFT internal processes.



## Telemetry Notice
Data Collection.

Expand Down

0 comments on commit 1a2540c

Please sign in to comment.