Signup Login
Try it for FREE!

Lastest Articles

Improving .NET Application Performance Part 11: Iteration and Looping

monitoring dot netIn this article in the optimizing .NET code series, we’ll discuss “Iteration and Looping”. Non-optimized code within loops can lead to performance issues, ranging from increased memory consumption to CPU exhaustion. This section summarizes guidelines that will improve iteration and loop efficiency:

Avoid Repetitive Field or Property Access

If your data is static for the duration of the loop, obtain it before the loop instead of repeatedly accessing a field or property. The following code shows a collection of orders being processed for a single customer.

for ( int item = 0; item < Customer.Orders.Count ; item++ ){

  CalculateTax ( Customer.State, Customer.Zip, Customer.Orders[item] );

}

Note that State and Zip are constant for the loop and could be stored in local variables rather than accessed for each pass through the loop as shown in the following code.

string state = Customer.State;

string zip = Customer.Zip;

int count = Customers.Orders.Count;

for ( int item = 0; item < count ; item++ )

{

  CalculateTax (state, zip, Customer.Orders[item] );

}

Note that if these are fields, it may be possible for the compiler to do this optimization automatically. If they are properties, it is much less likely. If the properties are virtual, it cannot be done automatically.

Optimize or Avoid Expensive Operations Within Loops

Identify operations in your loop code that can be optimized. Look for code that causes boxing or allocations as a side effect. The following code causes side effect strings to be created for each pass through the loop.
Read the full post

Category: Articles

Deploying ASP.NET applications with IIS 7

The primary function of the Internet Information Server (IIS) is to host Web based applications, such as ASP.NET. If you have to set your IIS 7 to host such an application, there are several terms you need to know and a procedure you have to follow. We will focus on them in this article.

In summary, with IIS 7, end users connect to an application by querying a site. Each site listens for clients’ requests through its bindings to virtual directories. Furthermore, each site is associated with a default, or root application, and one site may host many applications. Each application is also associated with an application pool. For each application pool there is at least one Worker Process (w3wp) and one application can be served by many Worker Processes (in a web garden). Now we’ll explain all of these terms one by one.
Read the full post

Category: Server Management, Web Server Monitoring

Improving .NET Application Performance Part 10: Exception Management

In this article in the optimizing .NET code series, we’ll discuss “Exception Management”. Structured exception handling using try/catch blocks is the recommended way to handle exceptional error conditions in managed code. You should also use finally blocks (or the C# using statement) to ensure that resources are closed even in the event of exceptions.

While exception handling is recommended to make your code more robust, there is a performance cost. Throwing and catching exceptions is expensive and thus you should use exceptions only in circumstances where it is required and never to control regular logic flow. We’ll outline the Exception Handling guidelines in the following sections.

Do Not Use Exceptions to Control Application Flow

Throwing exceptions is expensive. Do not use exceptions to control application flow. If you can reasonably expect a sequence of events to happen in the normal course of running code, you probably should not throw any exceptions in that scenario.

The following code throws an exception inappropriately, when a supplied product is not found.
Read the full post

Category: Articles

Improving .NET Application Performance Part 9: Boxing and Unboxing

In this next article in our series of creating optimized .NET code, we’ll discuss “boxing and unboxing”. In case you are unfamiliar with these terms, let’s take a brief look at what boxing and unboxing means.

You can convert value types to reference types and back again. When a value type variable needs to be converted to a reference type, an object (a box) is allocated on the managed heap to hold the value and its value is copied into the box. This process is known as boxing. Boxing can be implicit or explicit, as shown in the following code.

int p = 123;

Object box;

box = p;          // Implicit boxing

box = (Object)p;  // Explicit boxing with a cast

Boxing mostly occurs when passing a value type to a method that takes an object as parameter. When a value in an object is converted back into a value type, the value is copied out of the box and into the appropriate storage location. This process is known as unboxing.
Read the full post

Category: Articles

Nine Steps to Secure your Exchange Server

In this article we will list some steps you can take to make sure your Exchange Server is running as securely as possible.

1. Harden the OS

We can’t stress enough how important it is to harden the OS that is hosting the Exchange Server. It might seem obvious to you but, in fact, many IT professionals seem to forget about this first basic step. You can try to harden the OS by yourself, or use some of the tools available out there to help you. The important thing here is to disable all unnecessary services and to patch the server regularly.

2. Run MBSA, SCW, SCM, and EBPA
Read the full post

Category: Security

Trusted by:

trusted by trusted by trusted by trusted by trusted by trusted by trusted by trusted by trusted by trusted by
About Monitis

Monitis GFI is a specialist provider of web and Cloud monitoring services that include website monitoring, site load testing, transaction monitoring, application and database monitoring, Cloud resource monitoring, and server and internal network monitoring within one easy-to-use dashboard. Over 100,000 users worldwide have chosen Monitis as their provider of choice to increase uptime and user experience of their services and products. What makes Monitis' solutions different is that they are fast to deploy, feature-rich in technology and provide a comprehensive single-pane view of on-premise and off-premise infrastructure and applications.

Follow Monitis on Facebook
Follow Monitis on Twitter