Recently, web requests on my Api 2 w / Entity Framework 6.1 server have drastically reduced speed. Adding ~ 5000 ms to all queries querying the database. I spent the last three days tearing my hair out, trying to figure it out.
Setup:
- Web api 2.2
- Entity Framework 6.1.1
- Autofac for IoC, DbContext is InstancePerLifetimeScope () along with everything else.
- One custom HttpParameterBinding to get the object identifier from the access token. This makes a request to db.
- Only one DelegatingHandler to register requests
What I've done:
- Pre-created species, slight improvement
- Reduced properties in the objects we request, without improvement
- AutoTrackChanges disabled, no improvement
- AsNoTracking() ,
- Ant Performance Profiler,
- SQL Management Studio,
? DateTime.Now , 1745 . .SendAsync(request, cancelationToken), 6234. , 2 .
4489 , . . , , . ? ? - , , - , . .
: . , - , .