AcquireRequestState vs PreExecuteRequestHandler

We received a fairly large number of ajax calls that took a considerable amount of time in AcquireRequestState, in our travels we came across session fixation in ASP.Net, so we implemented a custom session state handler (based on the link below),

After making the changes and deploying them, we saw a very sharp drop in AcquireRequestState, but it was replaced by PreExecuteRequestHandler.

This morning it suddenly became clear to me that we turned on OWIN, which was probably the reason that PreExecuteRequestHandler took so long. Then I decided to remove this, and when I deployed the code, PreExecuteRequestHandler disappeared from the list. Unfortunately, it has now been replaced with AcquireRequestState again, to a large extent, at the same cost.

It seems to us that there are a lot of hits on AJAX calls that return partial views, AJAX calls that return primitive types, or JSON objects, apparently, are not significantly affected, despite the higher bandwidth.

So, this leaves me with three questions that I am absolutely fixated on, and I assume that the answer for one will lead us to the answer for the other 2.

1) Why is the cost of switching from AcquireRequestState to PreExecuteEventHandler when installing OWIN? Is something on OWIN marked as IRequireSessionState? (As I understand it, AcquireRequestState should have happened earlier in a managed pipeline)

2) How to get more information about what is going on inside this AcquireRequestState? Or is our time better spent returning a JSON object and using this to render what we need in the user interface?

3) We see a couple of requests (very few) that appear in / {controller} / {action} / {id} in New Relic and then get completely stuck throughout the request in the above, This despite limiting the limitations of our routing only on the way to the controllers and actions that we have in the project.

PS: : New Relic: AcquireRequestState

: , ASP.Net , ,

+12
2

, , , ( ), :

https://github.com/aspnet/AspNetSessionState

, , :

<add key="aspnet:AllowConcurrentRequestsPerSession" value="[bool]"/>

.Net Framework 4.6.2, .

0

, PreExecuteRequestHandler . . , .

!

0

Source: https://habr.com/ru/post/1670076/


All Articles