Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASP.NET Core] req/sec perf summary #5163

Conversation

vishweshbankwar
Copy link
Member

@vishweshbankwar vishweshbankwar commented Dec 13, 2023

Towards open-telemetry/opentelemetry-dotnet-contrib#1745
Design discussion issue #

Changes

The PR compares req/sec when the application is instrumented versus uninstrumented. For instrumentation, two different implementations are used, one uses a middleware and another one uses DiagnosticeSource callbacks.

=============No Instrumentation==============

bombardier-windows-amd64.exe -c 1 -n 1000000 https://localhost:51418/
Bombarding https://localhost:51418/ with 1000000 request(s) using 1 connection(s)
 1000000 / 1000000 [=====================================================================================================================================================================================] 100.00% 7332/s 2m16s
Done!
Statistics        Avg      Stdev        Max
  Reqs/sec      7339.78     396.08    8221.99
  Latency      134.26us    34.61us    27.00ms
  HTTP codes:
    1xx - 0, 2xx - 1000000, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:     2.21MB/s

=============Instrumentation via ASP.NET Core instrumentation library=========

bombardier-windows-amd64.exe -c 1 -n 1000000 https://localhost:51418/
Bombarding https://localhost:51418/ with 1000000 request(s) using 1 connection(s)
 1000000 / 1000000 [=====================================================================================================================================================================================] 100.00% 6535/s 2m33s
Done!
Statistics        Avg      Stdev        Max
  Reqs/sec      6537.11     386.67    7658.53
  Latency      151.59us    40.58us    34.38ms
  HTTP codes:
    1xx - 0, 2xx - 1000000, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:     2.31MB/s

===============Instrumentation via custom Middleware==================

bombardier-windows-amd64.exe -c 1 -n 1000000 https://localhost:51418/
Bombarding https://localhost:51418/ with 1000000 request(s) using 1 connection(s)
 1000000 / 1000000 [=====================================================================================================================================================================================] 100.00% 6386/s 2m36s
Done!
Statistics        Avg      Stdev        Max
  Reqs/sec      6389.96     384.45    7691.29
  Latency      155.26us    39.85us    30.05ms
  HTTP codes:
    1xx - 0, 2xx - 1000000, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:     2.26MB/s

Merge requirement checklist

  • CONTRIBUTING guidelines followed (nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

{
try
{
this.HttpInListener.OnEventWritten("Microsoft.AspNetCore.Hosting.HttpRequestIn.Start", context);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if using middleware approach, then HttpInListener should not be used, as that'll incur the cost of DS callbacks, which a middleware can avoid

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it won't, It does not enable DiagnosticSourceSubscriber which we do here

this.diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(httpInListener, this.isEnabled, AspNetCoreInstrumentationEventSource.Log.UnknownErrorProcessingEvent);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants