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

Lock contention in ChildRequestTrackingSuppressionModule.AddRequestToDictionary() #1345

Closed
paveliak opened this issue Oct 9, 2019 · 3 comments
Labels

Comments

@paveliak
Copy link

paveliak commented Oct 9, 2019

We had an incident with our service and while analyzing Perfview I observed severe lock contention with ConcurrentDictionary.AcquireAllLocks() coming from ChildRequestTrackingSuppressionModule.AddRequestToDictionary

ConcurrentDictionary.Count property acquires all locks which might cause lock contention under heavy load. Given that amount of items in this dictionary does not have to be exact please consider having a separate counter that you increment when adding item to the dictionary and taking the decision to create new dictionary basing on that counter (instead of Count property)

Repro Steps

Actual Behavior

Expected Behavior

Version Info

SDK Version : Microsoft.AI.Web, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
.NET Version : 4.7.2
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) :
OS : Windows server 2016
Hosting Info (IIS/Azure WebApps/ etc) : Azure, VM running IIS, we use VM scale sets

@cijothomas
Copy link
Contributor

@paveliak Thanks for reporting! Would you be willing to make a contribution to this?
cc: @TimothyMothra

@paveliak
Copy link
Author

@cijothomas I'll take a stab fixing it.

@TimothyMothra TimothyMothra transferred this issue from microsoft/ApplicationInsights-dotnet-server Dec 4, 2019
@github-actions
Copy link

This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 7 days.

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

No branches or pull requests

2 participants