Very slow C# and MVC site

Asked

Viewed 1,719 times

3

I developed a site in MVC and C#, but after deploying in Gogaddy server I have noticed that the first access is very, but very slow.

I practically check if there is a logged in user, if I do not have I redirect to the login screen to be made the access.

The part of the verification concerning the login, it takes a long time to be performed, but after all this is done, the site works normally, as if everything is normal.

Is there any tool where it is possible to see what and where is the neck of my site?

  • Does this delay occur at the beginning of the access of EACH section, or at the first access of the first section? That is, if you access from another machine, this delay will occur?

3 answers

4

This behavior is normal in the first publication. It occurs for two reasons:

  • As Views are recompiled in the first request;
  • As Migrations are executed if the first request makes some data access.

Now, if the slowness continues during requests, there may be a database bottleneck in your application. It is worth for these cases to perform a Debug of Actions that take longer to execute.

4

This is relatively common. ASP.NET MVC itself has many components that need to Warm-up to start working in order.

Of course, it may be that your case is a point outside the curve, but I believe that.

If you want to check what is delaying the execution you need to do the application drilling. Some tools available specific to this technology:

The phenomenon indicated in the other answer no longer happens in the latest versions, at least not sensitively.

  • 1

    +1 for these Profiling tools that I knew

2

Probably the Application Pool of your site is hibernating after a long downtime, common to happen with sites that still do not have many hits.

As it hibernates, it takes a while to reboot.

If it bothers you too much, you can :

1 - Check whether it is possible to reset the "Idle Timeout" on IIS. (I do not think)

2 - If this setting is not possible then to prevent the site from hibernating, you can use a monitoring or ping service that will "drip" your website url every minute, and so the site will no longer hibernate. You can also make a program that calls your website url every 10 minutes.

But once your site is used more, this "problem" will be less noticeable.

References : https://www.godaddy.com/help/customize-iis-settings-3971

http://hostingperformance.guru/2014/03/iis-application-pool/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.