umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.5k stars 2.69k forks source link

umbracoLock update causing Deadlocks #10599

Closed No1sBothered closed 3 years ago

No1sBothered commented 3 years ago

Which exact Umbraco version are you using? For example: 8.13.1 - don't just write v8

8.14

Bug summary

Looking at our SQL server log files we are seeing that the following SQL Query is causing deadlocks:

(@0 int)UPDATE umbracoLock WITH (REPEATABLEREAD) SET value = (CASE WHEN (value=1) THEN -1 ELSE 1 END) WHERE id=@0

Specifics

Umbraco 8.14 Azure Web App Azure SQL

Steps to reproduce

make 200 concurrent requests to Umbraco MembershipHelper and MembService.

Expected result / actual result

No response

emma-hq commented 3 years ago

Hey @No1sBothered,

Thanks also for this one. As with the issue here #10596, we'd recommend using an external membership provider for such high throughput. Is this something that is a blocker for you?

Emma

No1sBothered commented 3 years ago

@emma-hq is something like https://github.com/Shazwazza/UmbracoIdentity a solution?

No1sBothered commented 3 years ago

@emma-hq additionally if this was a blocker is there any way to mitigate the problems we are seeing?

emma-hq commented 3 years ago

Hey @No1sBothered

I asked if it was a blocker because it's really useful to us when we're scoping work or looking at the ways the CMS to grow to know if there are aspects of the build that hold people back. As it's not something we've been aware of happening out in-the-wild yet, it's really valuable for us to know if it's occurring.

In terms of mitigation, I can only suggest, at this point, extension and that would involve you looking at implementing something using an external membership provider that can work with high volumes, i.e. Identity Server.

The package above would be a great place to start if you wanted ASP.Net Identity and OWIN to work for Umbraco members on your front-end website.

Emma

No1sBothered commented 3 years ago

Thanks, Emma, would ASP.Net Identity and OWIN perform better than Umbraco MemberHelper and MemberService? As you can imagine with so many members using our site it is a critical issue as it brings down the entire site when the Deadlocks occur

emma-hq commented 3 years ago

Hey @No1sBothered

Each solution would have it's own pros and cons but Identity Server would scale better. I haven't much experience using it myself but if you pop over to our forum here you will no doubt find someone who has built something similar and would be willing to share their learnings. Lots of friendly folks over there with years of experience among them.

Let us know how you get on though! It's something we can factor into our planning. I'll close this for now but feel free to reference it in your forum post. All the best.

Emma