Last post Jun 10, 2019 08:55 AM by PatriceSc
May 29, 2019 07:54 AMemail@example.com|LINK
we have developed an application using ASP.NET/C# MVC 4.0, SQL SERVER 2012 DB, Entity Framework, WCF Service.
application website is hosted on IIS 10 and the operating system used is Windows Server 2016 and this is standalone WEB server dedicated for our project.
application WCF web service is hosted using Windows Service and this is standalone APP server dedicated for our project.
application database is hosted on SQL Farm and this is a common database server, where other projects databases (more than 60) are also hosted.
application is already running absolutely fine in PROD environment from couple of years.
but suddenly from couple of months, we started facing as intermittent issue and i.e. application slow response
There are no errors, but the response time is too long, and sometimes it doesn't respond either, the browser keeps waiting for the web server.
customer has complained that his web application gets slow sometimes.
It happens at random times, the system just gets slow then after few hours (2-3) it gets back on track with normal response times.
this slowness issue is affecting only to one specific MVC View, whereas other MVC views are rendering correctly at the same time when slowness issue occurs.
error handling is already in place in the .net code, but nothing gets logged in error log file.
also DBA has confirmed that there are no issues on the SQL Farm and none of the other projects apart from us has reported slowness issue whose database is also hosted on the SQL Farm.
when tried to reproduce the same issue on UAT with the same PROD database copy & same user, was not able to reproduce it.
UAT environment is exactly similar for WEB & APP server.
only in case of UAT database server, we do not have SQL Farm here. we have standalone database server dedicated for our project.
here tried doing some R&D and verified few things, but still unable to resolve the issue.
so could you please guide me here that what should i do/verify to resolve this issue.
thank you in advance for your inputs.
May 29, 2019 12:41 PM|AddWeb Solution|LINK
Typically an application will always take a little extra time to load as the application domain starts up.
Things helping exacerbate this could be anything from poorly written code (IE: Application_Start) to certain libraries you may be using (ORMs for example). How many modules do you have loaded?
For starters check your web.config for the infamous <compilation debug="true">. That can have significant performance ramifications in a production setup. Set it to "false"!
Recommend googling something along the lines of "improving application startup time" and looking for things that may relate to your particular application.
Update from your first comment:
If you're seeing the application start up again (hangs for a few seconds) after 30 minutes consistently this is likely related to your Application Pool Recycling settings in IIS.
Go into IIS Manager (this assumes v7+):
In terms of general performance you may want to try:
If you're really stumped #2 may be your best bet even though it will be probably be the slowest option.
May 29, 2019 12:57 PM|Mikesdotnetting|LINK
So, this only happens to one view, and has got worse over time? I would be looking at the database query that gets called for the view. How many records is it fetching? Have you looked at the query plan? Indexes etc?
May 29, 2019 03:11 PM|bruce (sqlwork.com)|LINK
issues like this is why you need to add metrics to your enterprise applications. you should be logging the time its takes to perform operations. on my application, there are detailed timing (and request) logging. I know how long every action, web service
call, and database call takes. This makes finding issues easier.
You might also use sql profiling to fins any long running queries (over 100 ms).
May 29, 2019 03:25 PM|yogyogi|LINK
I suffered such an issue sometime back. I later found out that the problems where only on database related pages i.e. the pages that are querying the database. I debug my application and found out that every time the response from the database was taking
some 10 seconds time. I then have to change my hosting altogether to move away from this slow database altogether.
Hope my experience helps you to resolve your issue.
Jun 06, 2019 01:09 PMfirstname.lastname@example.org|LINK
you are correct. from the entire web application, it's the signle view that is facing this slowness issue and that to in random months. this view is basically pulling data from database using entity framework objects. all data
is pulled correclty within it's time and then it's binded to view model. then this view is returned with the model. the entire code gets executed after returning view and then it just hangs. view / web page does not loads.
Jun 06, 2019 03:02 PM|bruce (sqlwork.com)|LINK
then its either:
1) the database query is slow. use sql profiler and query analysiser to fix. you want the query to under 500 ms.
2) the html rendering is slow. use the browser profiler to check this. if it is then you probably need to implement paging or virtual scrolling.
Jun 07, 2019 06:08 AMemail@example.com|LINK
the database query is not slow. it's returning data within time. and if it was the case then this particular view should always render slow, but this is not the case here. this view renders slow sometimes only and then after few hours (2-3) it gets
back on track with normal response times. so if there is a issue in database query or code then it should get slow always but this is not the case.
Jun 10, 2019 08:55 AM|PatriceSc|LINK
Doesn't have anything to do with how many entities are loaded ? For example I saw once a slow app that loaded much more data than needed and it was visible when many users using it.