Tuesday, March 19, 2013
Monday, March 18, 2013
Tuesday, March 12, 2013
Virtual Desktop Infrastructure Windows 2012 Server Hyper-V Virtual Machine Installation and Setup
What we get?
- Using virtual machine we can have independent isolated dev environment for each developer. Virtualize in terms of RAM and processor.
- Easy to enable new Virtual machine through template or image file i.e VHD.
- Easy to manage through system center 2012 i.e remote desktop services web enabled.
- Factors to be considered.
- Windows update.
- Anitvirus installation
- Software Licencing
- Security patches
- Backup strategy
- External data storage for developer. External drive to save file
Primary Server
OS : Windows Server Core 2008 R2
16 GB Ram Processor 4 GHz speed
VM1: 4 GB /1 Processor
VM2: 4 GB/1 Processor
VM3/VM4
Alternative to VDI: Remote Development server Session based RDP.
Is to enable Remote Destop Session based user option. This comes handly and just require to add limit to session users. No installation at all. All users will be having same set of underlying software and feature. Any changes to environment will affect all users and environment. Good in response widely used and opted.
Monday, March 11, 2013
Coding Tips and Tricks
Cyclic Constructor in C#
public class Car
{
//Private Member
private int m_CarID=int.MinValue;
private string m_CarType=string.Empty;
private string m_CarName=string.Empty;
private string m_Color=string.Empty;
private string m_Model=string.Empty;
//Constructor
public Car()
{
//default Constructor
}
//Parameterized Constructor
public Car(int carID, string carName)
{
m_CarID = carID;
m_CarName = carName;
}
//Cyclic Constructor
public Car(int carID, string carName, string carType,string carModel):this(carID,carName)
{
m_CarType = carType;
m_Model = carModel;
}
//Cyclic Constructor
public Car(int carID, string carName, string carType, string carModel,string color)
: this(carID, carName,carType,carModel)
{
m_Color = color;
}
}
static void main()
{
Car objCarA=new Car();
Car objCarB=new Car(1,"matiz");
Car objCarC=new Car(1,"matiz","SmallCar","2000");
Car objCarD=new Car(1,"matiz","SmallCar","2000","Dark Green");
}
Validation to Check for Comma separated EmailIDs
List of Email ids separated with [,] Email ID may contain character set as [._-']
^((\w+([-_.']\w+)*@\w+([-_.']\w+)*\.\w+([-_.']\w+)*)*([,])*)*$
Finite automata rule Values should proceed with email Ids with Comma Separated. No comma will precede the email IDs.
abc.xyz@anonymous.com
abc.xyz@anonymous.com,abc-xyz@anonymous.com,abc_xyz@anonymous.com
abc.xyz@anonymous.com,com,D'Souza@anonymous.com
abc.xyz
,abc.xyz@anonymous.com
abc.xyz@anonymous.com,
abc
Javascript
function CheckForCommaSeperatedEmailIDs( fieldValue )
{
var regex = /^((\w+([-_.']\w+)*@\w+([-_.]\w+)*\.\w+([-_.]\w+)*)*([,])*)*$/;
if( !fieldValue.match( regex ) )
{
alert('The Email IDs Invalid');
return false;
}
return true;
}
Validation to check UserID with Period/Dot seperated
1) Ratan.Tata
2) Anil.Dhiru.Ambhani
Ratan.
1) .Mukesh.
2) Amir.khan.
public class Car
{
//Private Member
private int m_CarID=int.MinValue;
private string m_CarType=string.Empty;
private string m_CarName=string.Empty;
private string m_Color=string.Empty;
private string m_Model=string.Empty;
//Constructor
public Car()
{
//default Constructor
}
//Parameterized Constructor
public Car(int carID, string carName)
{
m_CarID = carID;
m_CarName = carName;
}
//Cyclic Constructor
public Car(int carID, string carName, string carType,string carModel):this(carID,carName)
{
m_CarType = carType;
m_Model = carModel;
}
//Cyclic Constructor
public Car(int carID, string carName, string carType, string carModel,string color)
: this(carID, carName,carType,carModel)
{
m_Color = color;
}
}
static void main()
{
Car objCarA=new Car();
Car objCarB=new Car(1,"matiz");
Car objCarC=new Car(1,"matiz","SmallCar","2000");
Car objCarD=new Car(1,"matiz","SmallCar","2000","Dark Green");
}
Validation to Check for Comma separated EmailIDs
Regular Exp Description:
List of Email ids separated with [,] Email ID may contain character set as [._-']
Regular Expression
^((\w+([-_.']\w+)*@\w+([-_.']\w+)*\.\w+([-_.']\w+)*)*([,])*)*$
Regular expression Rules:
Finite automata rule Values should proceed with email Ids with Comma Separated. No comma will precede the email IDs.
Matches:
abc.xyz@anonymous.com
abc.xyz@anonymous.com,abc-xyz@anonymous.com,abc_xyz@anonymous.com
abc.xyz@anonymous.com,com,D'Souza@anonymous.com
Non-Matches:
abc.xyz
,abc.xyz@anonymous.com
abc.xyz@anonymous.com,
abc
Javascript
function CheckForCommaSeperatedEmailIDs( fieldValue )
{
var regex = /^((\w+([-_.']\w+)*@\w+([-_.]\w+)*\.\w+([-_.]\w+)*)*([,])*)*$/;
if( !fieldValue.match( regex ) )
{
alert('The Email IDs Invalid');
return false;
}
return true;
}
Validation to check UserID with Period/Dot seperated
Regular Expression Rules:
Finite automata rule, Values should precede with characters of set [A-Za-z] and followed with period(.) and character set [A-Za-z]Regular Expression:
^[a-zA-Z]+(\.[a-zA-Z]+)+$Matches
1) Ratan.Tata
2) Anil.Dhiru.Ambhani
Non-Matches
Ratan.
1) .Mukesh.
2) Amir.khan.
Regular Expression Logic in Javasctipt
| |||||||||||||||||
| Real Time Use Of Static Constructor if you look at above class it is an Utility class and it is consume by Business entity class instance say object Date that has minute component in it. If we have 10 screens that requires minutes to be displayed in dropdownlist in such cases rather then calling 10 calls to database or constructing this collection we prefer calling one instance at the very load of the application which in turns consume by all the pages and across all the users. In the process we have one instance available for all users and across pages. If one see in normal constructor ,one can notice it is invoked after instance is created whereas static constructor is invoked always first and when it is referenced. use System.collection.generics; public class Utility { public static IDictionary static Utility() { m_Minute=new IDictionary m_Minute.Add(1,"00"); m_Minute.Add(2,"15"); m_Minute.Add(3,"30"); m_Minute.Add(3,"45"); } public static IDictionary { return m_Minute; } }
Description :Below javascript code function returns false for entered special character and true for non special character.
Problem Statement:We have scenario where we have data stored in arraylist collection and want to pass this as data as input to Webservice method in string array format.
Namespace: System.collectionsSolution:
|
Sunday, March 10, 2013
Your Last chance Microsoft Virtual Academy
Join microsoft virtual academy for free . It has lot of online training courses which will help you develop your technical skills ,at the same time help you prepare one.
Benefits:
So hurry up!, You never know this may turns into paid one. Grab the opportunity and be one to rip benefit out of it. Share with this follow folks and friends . Help everyone.
Register now or never...
Benefits:
- Indirect trainings to appear for microsoft certifications.
- You develop your skill. Prepare strong foundation and clear your concepts and fundamentals.
- You get to know latest technology trends trainings in Vmware, Hyper v, Virtualization, Html5, Windows 8, Html ,mvc , mobile technology and many more. IOS,Android, Windows ..etc..
- You accumulate points to redeem for books, certifications or any valuable vouchers.
- You know where you stand.
- You get authentic transcripts of your courses.
So hurry up!, You never know this may turns into paid one. Grab the opportunity and be one to rip benefit out of it. Share with this follow folks and friends . Help everyone.
Register now or never...
https://www.microsoftvirtualacademy.com/GetStarted.aspx
Tuesday, February 19, 2013
Javascript Basics Tutprial Part 5: Self Calling Or Immediate function.
Lets look at syntax representation of Self calling or Immediate function call.
Method 1
(
function ()
{
something;
}
)
( ) ;//This is self fn call
Method 2
(
function ()
{
something;
}
( )
) ;
Method 3
(
function Anything()
{
something;
}
( )
) ;
The only difference is ( ) is inside or outside in the example above.
Chapter 5
Output
Method 1
(
function ()
{
something;
}
)
( ) ;//This is self fn call
Method 2
(
function ()
{
something;
}
( )
) ;
Method 3
(
function Anything()
{
something;
}
( )
) ;
The only difference is ( ) is inside or outside in the example above.
Chapter 5
Output
Monday, February 18, 2013
Javascript Basics Tutorial : Part 4 Var obj={};
Part 4 : var obj={};
Remember this semantics var X= {};
This chapter we will discuss how we can defined multiple methods and variable in OBJECT. The sample code describes the methods scope within OBJECTS and its declaration and semantics.
Understand diff between semantics and Syntax.
Chapter 4
Key notes here direct call to f1(), f2() and f() are INVALID. This is concepts of data encapsulation. Its implementations are hidden to outer world. Like we know how to drive car without knowing how it is internally deviced and operated.
Remember this semantics var X= {};
This chapter we will discuss how we can defined multiple methods and variable in OBJECT. The sample code describes the methods scope within OBJECTS and its declaration and semantics.
Understand diff between semantics and Syntax.
Chapter 4
Key notes here direct call to f1(), f2() and f() are INVALID. This is concepts of data encapsulation. Its implementations are hidden to outer world. Like we know how to drive car without knowing how it is internally deviced and operated.
Output
Javascript Basics Tutorial Part 3: Anonymous Methods
Anonymous Method Like C#.
Important Key notes:
Chapter 3:
Output
Important Key notes:
- All Methods are funtions but funtions are not method.
- Methods can not be called before it is being defined. Unlike FUNCTIONS.
- Methods is represented as variable and function is assigned to it.
- Methods is variable and any var declaration must ends with semicolon.
- Methods can be declared as Anonymous with no name and can be declared with Named Expression.
Chapter 3:
Output
Javascript Basics Tutorial Part 2: Simple Function.
Function Scoping: Function can be called before it is defined. Look at below example.
Function : By default every function is like default constructor with inbuilt arguments.
We can also put debugger; to put a breakpoint and debug to step-in, step-out, step-over in vs 2010.
In short we can defined function with NO Input Argument but we can pass multiple input parameter values of any type while calling a function.
f2(17, 0.1, "Ninja", [], {});
function f2()
{
//Fn Responsibilty & Operations.
}
Interesting facts: Inside a function we can fetch the inputs values to the function through a array called arguments[].Internally it is stored in arguments[] array placeholder where we can reference and use the input values for the operations.
Output
Javascript Basic Tutorial Part 1:Objects & Array
Here is the quick series of javascript begineer kit.
To make learning easy, below are the code demos with screenshot.
So lets get started
Objects & Array
All I have done is taken one default.aspx with all javascript references and one div tag to display results. We also have JQuery online reference just to have ready() function and few Jquery selector to create showresults() display panel.
Common Utility.JS
In order to simplify this kits, I have replaced alerts with ShowResults code snippet. There is a global array and global Method to display outputs. I'll be using ShowResults() Method to display output for each javascript demo.
Chapter 1. Objects & Array
This defination involves comma separated property and method. The important note here is dog object is notated as a var defined as class with property and method. Always remember closure always ends with semicolon as it is assigned to var . Like
To make learning easy, below are the code demos with screenshot.
So lets get started
Objects & Array
All I have done is taken one default.aspx with all javascript references and one div tag to display results. We also have JQuery online reference just to have ready() function and few Jquery selector to create showresults() display panel.
Common Utility.JS
In order to simplify this kits, I have replaced alerts with ShowResults code snippet. There is a global array and global Method to display outputs. I'll be using ShowResults() Method to display output for each javascript demo.
Chapter 1. Objects & Array
- var obj={} represents objects
- var arr=[] represents array
var dog={};
dog.breed='abc';
dog.bark= function(){
//some operations;
}
This defination involves comma separated property and method. The important note here is dog object is notated as a var defined as class with property and method. Always remember closure always ends with semicolon as it is assigned to var . Like
Tuesday, February 5, 2013
Linq with Lamda Expression
I've been searching around lot for good explanation on Linq and Lamda expression. Ultimately I end up with many and here are the few important ones that will really help us giving much more understanding that we need it.
MSDN Code Sample
http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b
Falling in Love with LINQ
http://www.fascinatedwithsoftware.com/blog/post/2011/10/31/New-England-Code-Camp-16.aspx
http://www.fascinatedwithsoftware.com/blog/post/2011/11/01/Falling-in-Love-with-LINQ-Part-1.aspx
MSDN Code Sample
http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b
Falling in Love with LINQ
http://www.fascinatedwithsoftware.com/blog/post/2011/10/31/New-England-Code-Camp-16.aspx
http://www.fascinatedwithsoftware.com/blog/post/2011/11/01/Falling-in-Love-with-LINQ-Part-1.aspx
Tuesday, January 22, 2013
Very Useful Jquery References
The best references
Six Things Every jQuery Developer Should Know
http://msdn.microsoft.com/en-us/magazine/ee730275.aspx
Object Oriented way of Jquery
http://msdn.microsoft.com/en-us/magazine/gg476048.aspx
How to Debug Your jQuery Code
http://msdn.microsoft.com/en-us/magazine/ee819093.aspx
http://milan.adamovsky.com/2012/04/on-april-26th-2012-i-presented-this.html
Unobstrusive Javascript
http://en.wikipedia.org/wiki/Unobtrusive_JavaScript
How to Create Your Own jQuery Plugin
http://msdn.microsoft.com/en-us/magazine/ff608209.aspx
Creating Responsive Applications Using jQuery Deferred and Promises
http://msdn.microsoft.com/en-us/magazine/gg723713.aspx
Introduction to Complex UIs Using jQuery UI
http://msdn.microsoft.com/en-us/magazine/hh127352.aspx
All In One Framework
http://www.elijahmanor.com/2010/06/my-7-jquery-articles-on-script-junkie.html
Object Oriented, functional and closure view of Jquery
Jquery =$
Well, I have been too much into Jquery. Being C# developer by nature its always been hard to adopt the style of programming in Jquery. What differentiate more is the style and modularization we have in C#. Apparently I like Jquery and try to code it as modular as I can.
Here is quick reference of MSDN magazine issue, Script Junkies....
http://msdn.microsoft.com/en-us/magazine/gg476048.aspx
Here you will understand following few important things.
By using the prototype feature you can achieve inheritance by simply setting the prototype of a derived object to an instance of the “parent” object.
Well, I have been too much into Jquery. Being C# developer by nature its always been hard to adopt the style of programming in Jquery. What differentiate more is the style and modularization we have in C#. Apparently I like Jquery and try to code it as modular as I can.
Here is quick reference of MSDN magazine issue, Script Junkies....
http://msdn.microsoft.com/en-us/magazine/gg476048.aspx
Here you will understand following few important things.
- Functional way of programming Jquery
- Jquery Plugins
- Objects in Jquery
- Object-orientation through Closures
- Object-orientation through Prototypes
- Inheritance In Jquery
- // Function to calculate a total
- var CalcTotal = function(x, y) {
- return x + y;
- };
- // Function to add taxes
- var AddTaxes = function(x) {
- return x * 1.2;
- };
- // Function that pipelines the other two
- var CalcTotalPlusTaxes = function (fnCalcTotal, fnAddTaxes, x, y) {
- return fnAddTaxes(fnCalcTotal(x, y));
- };
- // Execution
- var result = CalcTotalPlusTaxes(CalcTotal, AddTaxes, 40, 60);
- alert(result);
- jQuery.fn = jQuery.prototype = {
- init: function( selector, context ) { ... },
- size: function() { return this.length; },
- each: function( callback, args ) {
- return jQuery.each( this, callback, args ); },
- ready: function( fn ) { ... }
- :
- }
- var person = new Object();
- person.Name = "Dino";
- person.LastName = "Esposito";
- person.BirthDate = new Date(1979,10,17)
- person.getAge = function() {
- var today = new Date();
- var thisDay = today.getDate();
- var thisMonth = today.getMonth();
- var thisYear = today.getFullYear();
- var age = thisYear-this.BirthDate.getFullYear()-1;
- if (thisMonth > this.BirthDate.getMonth())
- age = age +1;
- else
- if (thisMonth == this.BirthDate.getMonth() &&
- thisDay >= this.BirthDate.getDate())
- age = age +1;
- return age;
- }
- var Person = function(name, lastname, birthdate)
- {
- this.Name = name;
- this.LastName = lastname;
- this.BirthDate = birthdate;
- this.getAge = function() {
- var today = new Date();
- var thisDay = today.getDate();
- var thisMonth = today.getMonth();
- var thisYear = today.getFullYear();
- var age = thisYear-this.BirthDate.getFullYear()-1;
- if (thisMonth > this.BirthDate.getMonth())
- age = age +1;
- else
- if (thisMonth == this.BirthDate.getMonth() &&
- thisDay >= this.BirthDate.getDate())
- age = age +1;
- return age;
- }
- }
- // Pseudo constructor
- var Person = function(name, lastname, birthdate)
- {
- this.initialize(name, lastname, birthdate);
- }
- // Members
- Person.prototype.initialize(name, lastname, birthdate)
- {
- this.Name = name;
- this.LastName = lastname;
- this.BirthDate = birthdate;
- }
- Person.prototype.getAge = function()
- {
- var today = new Date();
- var thisDay = today.getDate();
- var thisMonth = today.getMonth();
- var thisYear = today.getFullYear();
- var age = thisYear-this.BirthDate.getFullYear()-1;
- if (thisMonth > this.BirthDate.getMonth())
- age = age +1;
- else
- if (thisMonth == this.BirthDate.getMonth() &&
- thisDay >= this.BirthDate.getDate())
- age = age +1;
- return age;
- }
By using the prototype feature you can achieve inheritance by simply setting the prototype of a derived object to an instance of the “parent” object.
- Developer = function Developer(name, lastname, birthdate)
- {
- this.initialize(name, lastname, birthdate);
- }
- Developer.prototype = new Person();
Thursday, January 10, 2013
Tool to remove Forceful/Unwanted DLL from GAC Assembly
I have been searching this one for long time and thankfully I pressed a right button, Well ! I'm through.
http://abhi.dcmembers.com/blog/2009/04/17/forcefully-delete-an-assembly-from-gac/
http://abhi.dcmembers.com/blog/2009/04/17/forcefully-delete-an-assembly-from-gac/
- Open “regedit”
- Navigate to “HKEY_CLASSES_ROOT\Installer\Assemblies\Global”.
- Search for registered assemblies GAC.
- Delete the appropriate entry from this list.
Tuesday, January 8, 2013
Beginner MVC4 Web API : Learning 1
It’s been long time since I have
not been writing much here. Finally I got time to write something on
technology. I installed VS2012 professional and I took a first look of MVC4
framework web API. I don’t know how much application architect will see this framework
to work as per business need. It depends upon the requirement in all aspects
such performance, scalability, usability, availability, maintainability etc.
All these factors play a crucial role in deciding the adoption of any
architectural model or framework. Same goes with data architect and so on. Well
my take is always a model view presenter as I’ve been developing all my
application from my career start in MVP. Now it’s time to change and change is
always good. Everyone wants you to know and use MVC.
I followed the tutorial online which helped me understand
the basic.
Why MVC?
·
Clean URL
·
Loosely Coupled-Separation of concerns
·
Restful Service
·
Make use of Web API.Json, Jquery and Javascript
and lot
·
Mobile platform
·
Best for Unit testing
·
Flexible GUI/UI design.
·
Efficient Search engine Optimization
Some known characters in MVC
framework..I will not spend time talking much about the underlined definitions
of MVC and all . I would rather like one to know few important key things that
are must.
1)
MVC 4 framework development using Razor and
Scalfold templates.
2)
MVC4 Web API using JQuery, Json and JavaScript.
3)
MVC4 Filters, Routing, bundles and Web API
configuration.
If one tries to understand
above construct in much better form then it’s much easier to grasp the overall
learning of MVC 4 framework. Thanks GOD I started now as many revolutionary
changes have been done from MVC1 to MVC4. Hopefully I neither want to go in
past nor want to understand the flaws or round way of doing things.
Recommendation is to try below references to self start.
Guru Mantra: A
one video walktrough in your phone can help you touch base technology to place
you better in this world.
Download Learning Videos:
Wanna take break just Listen to this, Hotel California by
eagles.
Sunday, February 19, 2012
Performance Unrivaled: Quick heal solution to asp.net website performance
For me the performance of any web application can be assessed by only two important factors. One is processing of code in server and then carrying those processed output though network & wires to end users. If you processed your code faster than output transmittal through wire is another parameter that makes lot of difference. Its thumb rule, less weight faster it traverse through wire and get downloaded at browser much less time. My intention is to bring some light on these two things. There are different aspects of scale out and scale in approach to support huge user base but that is not my objective. My first level to assess any application is to probe these areas, what time it takes for any code to get processed and give output and next more interesting; how fast I can pass that output to end users browsers window?
1) Time to process input and give output
2) Time to transmit the processed output to end users
2) Time to transmit the processed output to end users
This is first level approach to improve performance of any system according to me. Then what comes next is, system capacity thereafter all planning to scale in or scale out servers to support concurrent/user base count. Not to waste much time out here understanding those nitty-gritty’s. My focus areas are,
Part 1
1) Code review. Reduce Warnings. Apply best practices Common e.g make use of string.builder , string.empty, string.IsnullOrEmpty()==true, Remove unwanted references.
2) Check cyclomatic complexity. Terminate unnecessary looping ,apply break if possible
3) Always keep tracing and bebug false
4) Use Server.transfert wherever possible
5) Make use of datareader wherever possible. Reduce use of dataset
6) Open and close the connection in the method.
7) Explicitly close connections in case of data reader.
8) When using DataReaders, specify CommandBehavior.CloseConnection.
9) Do not explicitly open a connection if you use Fill(SQL dataadapter or Update for a single operation.
10) Avoid checking the State property of OleDbConnection.
11) Connection Pooling.
12) Check for number of tier database calls. Say for example –if one page makes 20 database calls then this is of concerns. Reduce number of database call. Keep tier less chatty. Identify this bottleneck using VS2010 Tool.http://blogs.msdn.com/b/habibh/archive/2009/06/30/walkthrough-using-the-tier-interaction-profiler-in-visual-studio-team-system-2010.aspx
Part 2
1) Reduce Viewstate size. Tool Enable page trace=true at page level
2) Use JQuery +Jason for low weight data display. Popup etc.
3) Ajax
4) http://msdn.microsoft.com/en-us/library/ff647768.aspx
5) Remove Favicon.ico if not required .Use http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx
Reduce javascript file size .use Minify JS tool
Reduce CSS fie size .Use Minify CSS tool
Smush and optimizes image. Use All Smush.it tool. Check this out http://www.smushit.com/ysmush.it/
. Select file such image folder , css and javascript..
2.Click the HTTP Headers tab.
Select the Enable content expiration check box.
Click Expire immediately, Expire after, or Expire on, and type the appropriate expiration information in the corresponding boxes.Click OK.
ETAG
On the website’s entry right click->properties.
Select the HTTP Headers tab.
Add a new entry with Etag as the name, leaving the value blank.
In production environment disable debug mode and tracing option.
· Detailed Code Component
· Database changes
· Frontend Changes
· Server side configuration changes/Tuning
· What are we going to do?
· What are we going to achieve?
· Areas of Improvement.
· Tools for Performance Engineering
· Recommendation & Suggestions
· Pagination using database
· Sorting using database
· Search employee using database
· DC View using database
· Time Booking using database
· Export excel using database
· Refresh employee popup
· ***Very very important – Move dropdowns code in Page_Init for DC view.
· < asp:DropDownList ID="drpCountry" OnInit="drpCountry_Init" DataTextField="value" DataValueField="key" runat="server" TabIndex="1">
·
· //save viewstate
· protected void drpCountry_Init(object sender, EventArgs e)
· {
· IDictionary countryList = new Dictionary();
· countryList.Add(00, "INDIA");
· countryList.Add(01, "SRILANKA");
· countryList.Add(02, "NEPAL");
· countryList.Add(03, "BUTAN");
· //*** Bind Grid
· drpCountry.DataSource = countryList;
· drpCountry.DataBind();
· } http://www.dotnetspider.com/resources/33089-Save-Viewstate-Booste-Increase-asp-net-web.aspx
Remove unwanted view states at control level
Disable Logging in IIS
Remove Sticky Session- Disadvantage if one server fails user stick to same server as session is sticky.
Factor Availability Architecture Best Practice and Norms.
Enabled HTTP Compression in IIS
Using HTTpWatch we can eliminate http request 400 and 500 errorhttp://msdn.microsoft.com/en-us/library/ff647787.aspx
http://technet.microsoft.com/en-us/library/bb727100.aspx
Tools , That helps as Hook and Lever To drive this-
1) HttpWatch/fiddler
2) Performance counter
3) Logparser
4) Code aanlysis VS2010
5) FXcop
6) YSlow
The tuning process is an iterative processing that consists of the following set of activities.
We have to act methodically and with determination and be steadfast to overcome performance issue.
Combine all JavaScript and css files into one respectively.http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx
Design Principle Guidelineshttp://msdn.microsoft.com/en-us/library/ff647801.aspx
http://msdn.microsoft.com/en-us/library/ff649152.aspx
http://msdn.microsoft.com/en-us/library/ff647813.aspx
Friday, February 10, 2012
Performance Engineering -Unleash with YSLow Tool/Jslint
A Quick refresher on web page performance Tuning
YSlow is integrated into the Firebug web development tool for Firefox.
Note: YSlow is not integrated into Firebug Lite for Internet Explorer at this point in time.
1. Download and install Firefox: http://www.mozilla.com/en-US/firefox/personal.html
2. Download and install Firebug: http://getfirebug.com/
Note: Cannot be downloaded from IE
3. Download and install YSlow https://addons.mozilla.org/en-US/firefox/addon/5369
The parameter to test the web page for performance are listed Below
1. Make Fewer HTTP Requests
2. Compress Components with gzip
3. Minify JavaScript and CSS
4. Configure entity tags (ETags)
5. Reduce the number of DOM elements
6. Put CSS at top 7. Make JavaScript and CSS external
8. Avoid URL redirects
9. Make Ajax cacheable
10. Avoid HTTP 404 (not found) errors
11. Add Expires Headers
12. Put JavaScript at bottom
13. Remove Duplicate JavaScript and CSS
14. Use Get for Ajax Request
15. Reduce cookie size
The YSLow will list following details
The tool will show the details for each file:
· URL,
· when it expires
· the response time in ms to download the file
· ETAG
The bench mark for page performance:
· Page Size: 100K-150K
· Response Time: Less than 3000 ms in total
Additional Tool
Hope this help.
YSlow is integrated into the Firebug web development tool for Firefox.
Note: YSlow is not integrated into Firebug Lite for Internet Explorer at this point in time.
1. Download and install Firefox: http://www.mozilla.com/en-US/firefox/personal.html
2. Download and install Firebug: http://getfirebug.com/
Note: Cannot be downloaded from IE
3. Download and install YSlow https://addons.mozilla.org/en-US/firefox/addon/5369
The parameter to test the web page for performance are listed Below
1. Make Fewer HTTP Requests
2. Compress Components with gzip
3. Minify JavaScript and CSS
4. Configure entity tags (ETags)
5. Reduce the number of DOM elements
6. Put CSS at top 7. Make JavaScript and CSS external
8. Avoid URL redirects
9. Make Ajax cacheable
10. Avoid HTTP 404 (not found) errors
11. Add Expires Headers
12. Put JavaScript at bottom
13. Remove Duplicate JavaScript and CSS
14. Use Get for Ajax Request
15. Reduce cookie size
The YSLow will list following details
The tool will show the details for each file:
· URL,
· when it expires
· the response time in ms to download the file
· ETAG
The bench mark for page performance:
· Page Size: 100K-150K
· Response Time: Less than 3000 ms in total
Additional Tool
- JSLint
- All JS
- All JS Beatified
- All CSS
- All Smash.it
- All Js Minified
Hope this help.
Friday, January 20, 2012
IIS 7.5 Architecture Insights
Recently I started migration of applications from win 2003 OS platform to Win 2008. With this I decided to move to .net 4.0 and of course the IIS 7.5 What really surprise me the changes that has evolved in these technology, platform and environment in totally. The IIS and .net has matured lot and becoming stronger in each version releases Microsoft does.
IIS 6.0 vs 7.5 Architecture Insight
IIS6.0 -Web service Extension:We used to have web Server Extension. In IIS 6.0 is enabled only to support client static content and in order to enabled server side aspx, asp,.asmx, .svc, webdav, front page server extensions etc we have to make use of Web server Extension options in IIS( Inetmgr).
ALLOW and Prohibit Options Available.
IIS 7.5 -ISAPI & CGI this is exist in server extension in win server 2008 R2 or in Program On and Off feature in Control Panel. Once they are enabled it is available in IIS root.
IIS7.5 Integrated & Classic (6.0) mode of operatability.
IIS6.0- IIS and ASP.net has its own authorization/authentication model.
IIS7.5 Integrated Mode combines IIS & ASP.net Authentication/Authorization
IIS 6.0 Architecture
Architecture
Lsass.exe: Security and SSL
Inetinfo.exe: hosts the non-HTTP services and the IIS Admin Service, including the Metabase.E.g SMTP, FTP
SvcHost.exe: host operating system services; in the case of IIS, it hosts the Web (HTTP) service. www services, asmx, WAS – Window activation services for WCF binding –TCP and MSMQ
It has W3SVC.exe is user mode component that bridge communication between user mode and kernel mode. http listener handles request for kernel http stack through http.sys protocol stack
W3wp.exe: multiple W3wp.exe processes, one for each application pool.
ASPnet_ISAPI.dll
ISAPI Filter
ISAPI Extension
APP Domain
In Web-garden one application is divided into separate processes, -multiple instances of the same worker process.
IIS 7.5 Architecture
Additional Listener Adapter
Listener Adapter
World Wide Web Publishing Service (hosting the listener adapter)
NET.TCP listener adapter
NET.PIPE listener adapter
NET.MSMQ listener adapter
Protocol-specific listener adapters support all four WCF transports, instead of only HTTP in IIS 6.0. In addition, a new operating system service is available called Windows Activation Services (WAS). Both W3svc.exe and WAS are running inside an operating system host called SvcHost.exe
WAS is the new process activation service that is a generalization of Internet Information Services (IIS) features that work with non-HTTP transport protocols. WCF uses the listener adapter interface to communicate activation requests that are received over the non-HTTP protocols supported by WCF, such as TCP, named pipes, and Message Queuing.
WAS activation is not supported if the web server’s request processing pipeline is set to Classic mode. The web server’s request processing pipeline must be set to Integrated mode if WAS activation is to be used.
References
http://blogs.iis.net/nitashav/archive/2010/02/05/iis6-0-ui-vs-iis-7-x-ui-series-more-about-web-service-extensions.aspx
http://blog.monitis.com/index.php/2011/06/13/top-8-application-based-iis-server-performance-tips/
http://blog.monitis.com/index.php/2011/06/30/top-5-feature-based-iis-server-performance-tips/
http://blog.monitis.com/index.php/2011/06/26/iis-server-performance-tips/
http://learn.iis.net/page.aspx/38/planning-your-iis-architecture/
http://www.iis.net/ConfigReference/system.webServer/security/isapiCgiRestriction
http://msdn.microsoft.com/en-us/library/bb332338.aspx
http://learn.iis.net/page.aspx/101/introduction-to-iis-architecture/
IIS 6.0 vs 7.5 Architecture Insight
IIS6.0 -Web service Extension:We used to have web Server Extension. In IIS 6.0 is enabled only to support client static content and in order to enabled server side aspx, asp,.asmx, .svc, webdav, front page server extensions etc we have to make use of Web server Extension options in IIS( Inetmgr).
ALLOW and Prohibit Options Available.
IIS 7.5 -ISAPI & CGI this is exist in server extension in win server 2008 R2 or in Program On and Off feature in Control Panel. Once they are enabled it is available in IIS root.
IIS7.5 Integrated & Classic (6.0) mode of operatability.
IIS6.0- IIS and ASP.net has its own authorization/authentication model.
IIS7.5 Integrated Mode combines IIS & ASP.net Authentication/Authorization
IIS 6.0 Architecture
Architecture
Lsass.exe: Security and SSL
Inetinfo.exe: hosts the non-HTTP services and the IIS Admin Service, including the Metabase.E.g SMTP, FTP
SvcHost.exe: host operating system services; in the case of IIS, it hosts the Web (HTTP) service. www services, asmx, WAS – Window activation services for WCF binding –TCP and MSMQ
It has W3SVC.exe is user mode component that bridge communication between user mode and kernel mode. http listener handles request for kernel http stack through http.sys protocol stack
W3wp.exe: multiple W3wp.exe processes, one for each application pool.
ASPnet_ISAPI.dll
ISAPI Filter
ISAPI Extension
APP Domain
In Web-garden one application is divided into separate processes, -multiple instances of the same worker process.
IIS 7.5 Architecture
Additional Listener Adapter
Listener Adapter
World Wide Web Publishing Service (hosting the listener adapter)
NET.TCP listener adapter
NET.PIPE listener adapter
NET.MSMQ listener adapter
Protocol-specific listener adapters support all four WCF transports, instead of only HTTP in IIS 6.0. In addition, a new operating system service is available called Windows Activation Services (WAS). Both W3svc.exe and WAS are running inside an operating system host called SvcHost.exe
WAS is the new process activation service that is a generalization of Internet Information Services (IIS) features that work with non-HTTP transport protocols. WCF uses the listener adapter interface to communicate activation requests that are received over the non-HTTP protocols supported by WCF, such as TCP, named pipes, and Message Queuing.
WAS activation is not supported if the web server’s request processing pipeline is set to Classic mode. The web server’s request processing pipeline must be set to Integrated mode if WAS activation is to be used.
References
http://blogs.iis.net/nitashav/archive/2010/02/05/iis6-0-ui-vs-iis-7-x-ui-series-more-about-web-service-extensions.aspx
http://blog.monitis.com/index.php/2011/06/13/top-8-application-based-iis-server-performance-tips/
http://blog.monitis.com/index.php/2011/06/30/top-5-feature-based-iis-server-performance-tips/
http://blog.monitis.com/index.php/2011/06/26/iis-server-performance-tips/
http://learn.iis.net/page.aspx/38/planning-your-iis-architecture/
http://www.iis.net/ConfigReference/system.webServer/security/isapiCgiRestriction
http://msdn.microsoft.com/en-us/library/bb332338.aspx
http://learn.iis.net/page.aspx/101/introduction-to-iis-architecture/
Subscribe to:
Posts
(
Atom
)