Giter VIP home page Giter VIP logo

azure-signalr-bench's Introduction

Setup

Dependency

  1. WSL or Linux
  2. az cli [Version >=2.37]
  3. .NET 6 sdk
  4. A tenant you are allowed to register AAD applications
  5. jq , nodejs , npm, helm

To avoid dealing with those dependencies (except 4), you could use Azure Cloud Shell to run all the scripts. The dependencies have been installed in the Azure Cloud Shell env already.

In the Azure Cloud shell: Bash (Recommended ๐Ÿ˜€)

git clone --single-branch --branch v2 https://github.com/Azure/azure-signalr-bench.git

Use Azure Cloud Shell to init the resouces

Steps

SignalR performance tool uses AKS to run the tests. To setup the initial environment, you could run below script. ๐Ÿ˜ƒ Make the [prefix] unique. [location] is the region you put your resouces in like eastus.

โš ๏ธ Below init script will create resources and generate cost !

cd Initialize && chmod +x ./*.sh
./init.sh -p [prefix] -l [location]  ## This will take about 20 minutes

Grant permission to users/groups

  1. Assign the Contributor role to allowed users First find your service principle in your AAD Enterprise applications. Use your [prefix] to search the service principle

find-service-principle

Select the service principle and add user/group. This will determine who can access the test tool portal. 

You can come back and add more people later. Add yourself now.

Grant permission to user or group

  1. Modify the Azure AAD config (clientID and TenantID) in src/Pods/Portal/appsettings.json accordingly(Use the clientID and tenantID of the Application you just created).

After that, you need to init the deployments inside the aks

./publish.sh -p [prefix] -a #This will take about 20 minutes

Now everything is ready, you could go to the printed url to create performance tests! ๐Ÿ˜Š

FAQs

  1. Failed trying to add nodePool or setup aks. Failed to scale up VMs after starting a test.

VM quota issues: You need to change the VM size according to the quota in your subscription or request VM quota. The current used VM SKU is Standard_D4s_v3. You could also use other VM types. But make sure the VM type has at least 4 cores. The node pool could be added in the AKS node pool configration.

image

Outbound IP port issue: You need to add more ips to your load balancer if you trying to add a large node pool

  1. SSL cert not safe

NSG issue: If the NSG in the created AKS resource group blocks inbound traffic, the SSL certificate verification would fail.

  1. What's the portal domain? Run below command to get the urls

./publish -p [prefix]

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

azure-signalr-bench's People

Contributors

bjqian avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar terencefan avatar vwxyzh avatar zackliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-signalr-bench's Issues

Bench as a global .NET tool

Has the team considered packaging Bench up as a .NET Core global tool and shipping it on NuGet? I think it'd be an interesting tool for customers to have right there on the command line for benchmarking SignalR endpoints.

cc @davidfowl @anurse @chenkennt for your thoughts

IndexOutOfRangeException while running default scenario

Hi, I just installed the tool in my Windows pc using

dotnet tool install --global Microsoft.dotnet-signalr-benchmark --version 1.0.56301

but as soon as I start the test I got this exception that prevents the test to continue.

2021-04-30 17:11:30.162 +02:00 [ERR] System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Plugin.Microsoft.Azure.SignalR.Benchmark.SignalRUtils.Percentile(Int32[] sequence, Double excelPercentile) in C:\Users\giacomo.deliberali\Desktop\azure-signalr-bench-master\src\signalr\Utils\SignalRUtils.cs:line 886
   at Plugin.Microsoft.Azure.SignalR.Benchmark.SignalRUtils.<>c__DisplayClass48_0.<MergeConnectionStatistics>b__0(Double i) in C:\Users\giacomo.deliberali\Desktop\azure-signalr-bench-master\src\signalr\Utils\SignalRUtils.cs:line 847
   at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
   at Plugin.Microsoft.Azure.SignalR.Benchmark.SignalRUtils.MergeConnectionStatistics(IDictionary`2[] results, Double[] percentileList) in C:\Users\giacomo.deliberali\Desktop\azure-signalr-bench-master\src\signalr\Utils\SignalRUtils.cs:line 846
   at Plugin.Microsoft.Azure.SignalR.Benchmark.MasterMethods.CollectStatisticBase.ConnectionStatEventerCallback(IDictionary`2 stepParameters, IDictionary`2 pluginParameters, IList`1 clients) in C:\Users\giacomo.deliberali\Desktop\azure-signalr-bench-master\src\signalr\MasterMethods\CollectStatisticBase.cs:line 121
   at Plugin.Microsoft.Azure.SignalR.Benchmark.MasterMethods.CollectStatisticBase.<>c__DisplayClass11_0.<<CollectStatistics>b__0>d.MoveNext() in C:\Users\giacomo.deliberali\Desktop\azure-signalr-bench-master\src\signalr\MasterMethods\CollectStatisticBase.cs:line 78

Are there any other tool versions to try out?

Can't figure out how to benchmark my own ASP.NET hub

I've tried to run the benchmark on my application signalr hub but can't figure out how to.

I've added SignalRBench Hub from https://github.com/clovertrail/AspNetServer/blob/master/SignalRBench.cs
But w/e URL I put in echo.yaml the test can't seem to connect to the Hub. I can only run tests on the built-in app (dotnet signalr-bench application).
I've also ran the https://github.com/clovertrail/AspNetServer itself and can't seem to connect to it with bench tests.

Could you provide an example that uses app.MapSignalR(); and provides valid app and echo.yaml?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.