Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Many calls to mini-profiler-resources on one page

I have a weird problem, I'm using MiniProfiler and it's great, no problem whatsoever on my local machine but it seems to behave differently on our testing server. It seems to generate many queries to mini-profiler-resources, where number of queries is random (?). It is generating somewhere between 8 to 22 extra calls.

Testing and local machine is using basically the same data. We are using MVC 3 and RavendDB (with RavenDB MiniProfiler plugin).

I would be happy to get any suggestions what it could possibly be. Thanks.

Many calls Many calls Chrome network graph

like image 204
Dawid Kowalski Avatar asked Nov 25 '25 18:11

Dawid Kowalski


1 Answers

It turned out that out current load balancer was hiding user ip address behind his. Additionally we had few services constantly sending uptime requests that because of load balancer were identified by the same ip.

MiniProfiler by default is storing request profiling results per ip. These results are read asynchronously by client side request and only when they were read they are cleared. It meant that I was getting all the profiling results made by uptime services that were not mine but since we had the same ip they were identified as mine.

Possible available solutions:

  • Ensure that your IIS is getting unique IP's
  • MiniProfiler allows extensibility point for IUserProvider (https://github.com/SamSaffron/MiniProfiler/blob/master/StackExchange.Profiling/IUserProvider.cs) so if necessary we can distinguish users in some other way. GetUser is getting HttpRequest as an argument. One way could be for example to read Session Id from cookies passed in HttpRequest.
like image 127
Dawid Kowalski Avatar answered Nov 28 '25 02:11

Dawid Kowalski