Saturday, May 9, 2015

Application Pools in IIS

Application pool is a way to manage multiple web applications under IIS server. App pools allows you to isolate applications with different security controls from one another. It helps you to manage your applications separately. 


IIS Worker Process
Is a Windows process (w3wp.exe) which runs web applications. It is responsible for handling requests for a specific application pool. App pool can contain more than one worker process. This is known as web farm or web garden. Read here

Application Pool Recycling
To make the application running smooth without memory leaks you need  to recycle the application pool. Any code which failed to implement IDisposable would run finalizers which will release resources.


Identity

Application Pool Settings (General)
  • .NET CLR Version
    • This should correspond to appropriate version of .NET framework version of your application
  • Managed Pipeline Mode
  • Queue Length
    • Max No. of requests HTTP.sys will queue for the app pool. When queue is full you'll get 503 "Service Unavailable" error
  • Start Mode : OnDemand or Always Running. See (SimpleTalk - Speeding up your application with Auto-Start feature)

Resources

Friday, May 1, 2015

LINQ in Entity Framework

To retrieve lists from database you can use IEnumerbale<T> or IQueryable<T> interfaces. IQueryable allows you to do LINQ-to-SQL while IEnumerable<T> is LINQ-to-Objects. Both gives you the opportunity to do deferred execution. (Read this article for more).

In IEnumerable all objects matching the original query will be loaded to the memory from database. 

Above first and last LINQ statements will generate first SQL query while second LINQ expression will generate the second query below,

LINQ First and FirstOrDefault


LINQ Single and SingleOrDefault


LINQ Any
Note that Count will iterate all the records in the table while Any will stop at first record it finds. (source)

LINQ Count and LongCount



The difference between Count and Count_Big is latter returns bigint while count returns int. See more details on data types.

LINQ Contains




















Group by
Powered by Blogger.


Software Architect at Surge Global/ Certified Scrum Master

Experienced in Product Design, Software Engineering, Team management and Practicing Agile methodologies.

Search This Blog

Facebook