|
1 | 1 | # Benchmarks
|
2 | 2 | Benchmarks for ASP.NET Core including (but not limited to) scenarios from the [TechEmpower Web Framework Benchmarks](https://www.techempower.com/benchmarks/).
|
3 | 3 |
|
4 |
| -The current results tracked by the ASP.NET team are available [at this location](https://aka.ms/aspnet/benchmarks). |
| 4 | +The current results tracked by the ASP.NET team are available at [https://aka.ms/aspnet/benchmarks](https://aka.ms/aspnet/benchmarks). |
5 | 5 |
|
6 | 6 | # Setting up
|
7 | 7 |
|
8 |
| -## Components |
| 8 | +These benchmark applications and docker images work best when used with [Microsoft Crank](https://github.com/dotnet/crank). Follow the instructions in the Crank repository in order to run the benchmarks on your own machines. |
9 | 9 |
|
10 |
| -The benchmarking infrastructure is made of these components: |
11 |
| -- [Benchmarks](https://github.com/aspnet/benchmarks/tree/main/src/Benchmarks), a web application that contains different scenarios to benchmark. |
12 |
| -- [BenchmarksServer](https://github.com/aspnet/benchmarks/tree/main/src/BenchmarksServer), a web application that queues jobs that are able to run custom web applications to be benchmarked. |
13 |
| -- [BenchmarksClient](https://github.com/aspnet/benchmarks/tree/main/src/BenchmarksClient), a web application that queues jobs that can create custom client loads on a web application. |
14 |
| -- [BenchmarksDriver](https://github.com/aspnet/benchmarks/tree/main/src/BenchmarksDriver), a command-line application that can enqueue server and client jobs and display the results locally. |
15 |
| -- A database server that can run any or all of PostgreSql, Sql Server, MySql, MongoDb |
| 10 | +# Scenarios |
16 | 11 |
|
17 |
| -## Setting up the infrastructure |
18 |
| - |
19 |
| -This will assume you have Docker installed and are familiar with it. |
20 |
| - |
21 |
| -### Setup the Benchmark Server |
22 |
| - |
23 |
| -- Clone https://github.com/aspnet/benchmarks on the __main__ branch |
24 |
| -- Run `cd docker/benchmarks` |
25 |
| -- Run `./build.sh`, which will build a Docker image containing the benchmarking dependencies |
26 |
| -- Add the following environment variables to the file `/etc/environment` |
27 |
| - - Set the environment variable `DBHOST=10.0.0.103` by replacing the IP with the one used to communicate with the database server |
28 |
| - - Set the environment variable `server_ip=10.0.0.102` by replacing the IP with the one used to communicate with the benchmark server |
29 |
| - - Set the environment variable `hardware_version=HPZ440` by replacing with a description of the hardware. This will be used when storing the results to distinguish environments |
30 |
| -- Edit the file `/etc/hosts` and add `10.0.0.103 TFB-database` with the IP to the database server |
31 |
| -- Run `./run-server.sh` |
32 |
| - |
33 |
| -The application should start on port `5001`. Open a browser on this page and `OK` should be displayed. |
34 |
| - |
35 |
| -### Setup the Benchmark Client |
36 |
| - |
37 |
| -- Clone https://github.com/aspnet/benchmarks on the __main__ branch |
38 |
| -- Run `cd docker/benchmarks` |
39 |
| -- Run `./build.sh`, which will build a Docker image containing the benchmarking dependencies |
40 |
| -- Then run `./run-client.sh` |
41 |
| - |
42 |
| -The application should start on port `5002`. Open a browser on this page and `OK` should be displayed. |
43 |
| - |
44 |
| -### Setup the Database Server |
45 |
| - |
46 |
| -- Clone https://github.com/aspnet/benchmarks on the __main__ branch |
47 |
| - |
48 |
| -#### PostgreSql |
49 |
| - |
50 |
| -- Run `cd docker/postgres-techempower` |
51 |
| -- Run `./build.sh` |
52 |
| -- Then run `./run.sh` |
53 |
| - |
54 |
| -This will create and run a Docker image containing PostgreSql and the Fortunes database that is used by Tech Empower scenarios. |
55 |
| - |
56 |
| -### Run a job |
57 |
| - |
58 |
| -On your computer, |
59 |
| - |
60 |
| -- Clone https://github.com/aspnet/benchmarks on the __main__ branch |
61 |
| -- Run `cd src/BenchmarksDriver` |
62 |
| -- Then run the following command after replacing the IP addresses to the ones you are using, |
63 |
| -``` |
64 |
| -dotnet run -c Debug \ |
65 |
| - --server "http://10.0.0.102:5001" \ |
66 |
| - --client "http://10.0.0.101:5002" \ |
67 |
| - --jobs "../Benchmarks/benchmarks.json.json" \ |
68 |
| - --scenario Json |
69 |
| -``` |
70 |
| - |
71 |
| -This will start the `Json` scenario using the `Benchmarks` application that is provided in https://github.com/aspnet/benchmarks/tree/main/src/Benchmarks. |
72 |
| -You can use another application by setting the correct arguments described on [this page](https://github.com/aspnet/benchmarks/blob/main/src/BenchmarksDriver/README.md). |
73 |
| - |
74 |
| -#### Selecting a database provider |
75 |
| - |
76 |
| -Some of the `Benchmarks` application scenarios require the database to be selected from the driver. |
77 |
| -By default no database driver will be configured and these scenarios will fail. For instance, running the |
78 |
| -`DbFortunesEF` scenario will require the driver to have the `--database` argument. |
79 |
| - |
80 |
| -A good default is `--database PostgreSql` which will use NpgSql, but other providers are available. See the command line |
81 |
| -arguments for the available ones. |
82 |
| - |
83 |
| -#### Storing the results |
84 |
| - |
85 |
| -The driver application can store the results of a job by passing a `-q [connectionstring]` argument. The connection |
86 |
| -string must point to an existing SQL Server database. The first time it's called the required table will be created. |
87 |
| -From there you can create reports using the tools of your choice. |
| 12 | +The ASP.NET team runs all the scenarios in this repository as part of a continuous benchmarking effort. |
| 13 | +The scenarios that are available to use with Crank and some sample command lines are available on [the scenarios page](https://github.com/aspnet/Benchmarks/tree/main/scenarios). |
0 commit comments