Posts

Showing posts with the label ASP.NET MVC

Dynatrace - .NET Trending / Leak Analysis Memory Snapshot

Image
If you use Dynatrace, please be aware that if you are using option of ".NET Trending/Leak-Analysis Memory Snapshot" option to "Always On". (System Profile > Agent Group > Agent Mapping > Advanced), to analyze memory leaks in .NET, this may result in higher response times, elevated CPU usage on your web servers and/or higher times spent in garbage collection. These changes to time spent in garbage collection can be observed from the PurePath breakdown(s). When not in use, please set to "Automatic" (Preferred) or "Always Off" to limit the performance impact to your web servers.

ASP.NET MVC - Disabling Browser Link

Image
You may be experiencing unexpected errors and performance impacts as a result of a capability added within Visual Studio 2013, titled Browser Link. The intent of Browser Link, was to allow the IDE to (bi-directional) communicate with the browsers (using SignalR), and allow for refreshing multiple browsers at once ("via Refreshing Linked Browsers"). In the circumstance that you are experiencing the following issues, The web application / scripts being loaded, are taking extensive periods of time to load, as a result of javascript / jQuery errors being returned to the client. The CPU usage between IIS Worker Process (W3WP) is increasing outside normal bounds. HTML markup contains garbage tags, as a result of the HttpModule associated with Browser Link. You can disable the Browser Link capability, by either using Visual Studio settings, or by disabling in the web configuration. Visual Studio [ source ] In the Browser Link dropdown menu, uncheck Enable Browser Li...

C# / SQL - Performing Distributed Transactions

Distributed Transactions span across multiple processes, which when encapsulated by the distributed transaction manager, will either commit a successful transaction or rollback changes. Distributed Transactions have been available within .NET, since .NET Framework 2.0. The Default Isolation level is set to Serializable , which in usage, creates unnecessary blocking and deadlocks. Therefore, it is suggested you override the default isolation level to ReadCommitted, which reflects the default within SQL Server. /// /// This class is responsible for performing Distributed Transactions. /// public class DistributedTransactionUtility { /// /// The Distributed Transaction method which creates a Transaction Scope object /// and commits if there is no error and rollbacks, incase of exception. /// /// /// The method which performs multiple DB Transactions. /// public void DoDistributedTransaction(Action method) { // Initializes Transac...

ASP.NET MVC - Using CDNs (Content Delivery Network)

By utilizing content delivery networks (CDN)s, you will potentially receive several benefits including improved performance, gains from using different domains, pre-cached files, high-capacity infrastructure and distributed data centers. A CDN can distribute the load, save bandwidth, and boost performance. As individual users request static resources such as javascript and stylesheets, browsers limit the number of concurrent connections (or file downloads) to a single domain at a given time, thus allowing users to download additional requests. Additionally, many CDNs provide localized data centers which are closer to the user, and faster to download. For example, if you are browsing your application's site in San Francisco and need to download the javascript or stylesheets, assuming the CDN has a datacenter in California, it would utilize that location to download the file opposed to making the round trip to your local servers (e.g. could be hosted across the country). In terms of...

IIS / ASP.NET - Run all Managed Modules for All Requests (RAMMFAR)

When initially creating an ASP.NET web application, RunAllManagedModulesForAllRequest is enabled by default. If enabled, every request that passes through the ASP.NET pipeline, is treated as a managed modules (or handlers). When all modules are managed, including static content, there are possible performance implications. If you are utilizing a distributed cache provider, such as App Fabric, an implication includes that all managed resources, including static content are passed to the distributed cache (as managed resources), which adds a level of overhead, even if not required. The solution to optimizing your web application, is to disable runAllManagedModulesForAllRequests (RAMMFAR), and add defined locations for your static resources within your web configuration file. The static resources can include but are not limited to CSS, Images, and Scripts. Firstly, you will want to add location segments for each file/folder location, within the configuration element. ... ...