Skip to content

IOptionsSnapshot Results in High CPU 100% at 1500 RPS with 15 Node Cluster (8core per vm 32GB Memory) #42222

Closed

Description

@justConfused

If you believe you have an issue that affects the security of the platform please do NOT create an issue and instead email your issue details to [email protected]. Your report may be eligible for our bug bounty but ONLY if it is reported through email.

Describe the bug

IOptionsSnapshot Results in High CPU 100% at 1500 RPS with 15 Node Cluster (8core per vm 32GB Memory). HTTP.Sys Asp Net core 2.1

It looks like Wait on GC is blocking for some mutex as captured traces from azure profile show. Image below.

To Reproduce

Steps to reproduce the behavior:
1.) Start Azure Vm StandardDv2_v8
2.) 100 RPS
3.) HTTP.SYS(AspNetCore): Add IOptionsSnapshot as scoped depend so it created on ever request
4.) CPU should 100

Expected behavior

High CPU

Screenshots

image

Activity

  1. davidfowl commented on Aug 13, 2020

    @davidfowl
    Member

    IOptionsSnapshot<T> might be a performance trap indeed since binding isn't currently cached and runs per request:

    cc @HaoK @Pilchie for 3.x
    cc @ericstj @maryamariyan

    This is something we might want to address in 5.0 or 6.0 and backport to 3.1.

  2. HaoK commented on Aug 13, 2020

    @HaoK
    Member

    We don't use options snapshot anywhere by default right? But yeah config binding every request is going to be extremely slow

  3. added
    untriaged
    on Sep 14, 2020
  4. BrennanConroy commented on Sep 14, 2020

    @BrennanConroy
    Member

    This is something we might want to address in 5.0 or 6.0

    6.0 😄

  5. removed
    untriaged
    on Sep 16, 2020
  6. added this to the 6.0.0 milestone on Sep 16, 2020
  7. added
    tenet-performance
    on Sep 16, 2020
  8. davidfowl commented on Oct 2, 2020

    @davidfowl
    Member

    @maryamariyan we should close as dupe of #36130

  9. ghost locked as resolved and limited conversation to collaborators on Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions