Wednesday 1 April 2015

Web-Farm & Web Garden


Introduction
Web Farms and Web Garden are very common terminology for any production deployment. Though these terms look same but the things are totally different. Many beginners very confused with these two terms. Here I am giving the basic difference between the Web Farm and Web Garden.
Web Farm
After developing our asp.net web application we host it on IIS Server.  Now one standalone server is sufficient to process ASP.NET Request and response for a small web site but when the site comes for big organization where there a million of daily user hits then we need to host the sites on multiple Servers. This is called web farms. Where single site hosted on multiple IIS Servers and they are running behind the Load Balancer.
Fig : General Web Farm Architecture
This is the most common scenarios for any web based production environment. Where Client will hit an Virtual IP ( vIP). Which is the IP address of Load Balancer? When Load balancer received the request based on the server load it will redirect the request to particular Server.
Web Garden
All IIS Request process by worker process ( w3wp.exe). By default each and every application pool contains single worker process. But An application pool with multiple worker process is called Web Garden.   Many worker processes with same Application Pool can sometimes provide better throughput performance and application response time. And Each Worker Process Should have their own Thread and Own Memory space.
There are some Certain Restriction to use Web Garden with your web application. If we use Session Mode to "in proc", our application will not work correctly because session will be handled by different Worker Process. For Avoid this Type of problem we should have to use Session Mode "out proc" and we can use "Session State Server" or "SQL-Server Session State".
How To Configure Web Garden?
Right Click on Application Pool > Properties > GoTo Performance Tab
In bottom Group Section  Increase the Worker Process Count.



Web-Part life Cycle in SharePoint



On Page Load
1.Constructor
2.OnInit
3.OnLoad
4.ConnectionConsumer method is called if web part is connectable (sets the connection providers interface in the webpart)
5.CreateChildControls
6.OnPreRender (if your web part is connectable you would typically call the connection provider here to retrieve data)
7.SaveViewState
8.Render
9.RenderChildren
10.RenderContents
On 1st Postback
(PostBack click handler sets ViewState via public Property)
1.Constructor
2.OnInit
3.CreateChildControls
4.OnLoad
5.PostBack click handling
6.ConnectionConsumer method is called if web part is connectable (sets the connection providers interface in the webpart)
7.OnPreRender (if your web part is connectable you would typically call the connection provider here to retrieve data)
8.SaveViewState
9.Render
10.RenderChildren
11.RenderContents
On 2nd Postback
(PostBack click handler sets ViewState via public Property)
1.Constructor
2.OnInit
3.LoadViewState
4.CreateChildControls
5.OnLoad
6.PostBack click handling
7.ConnectionConsumer method is called if web part is connectable (sets the connection providers interface in the webpart)
8.OnPreRender (if your web part is connectable you would typically call the connection provider here to retrieve data)
9.SaveViewState
10.Render
11.RenderChildren
12.RenderContents
Note that during the 2nd postback, LoadViewState, is called, since in the 1st postback the click handler sets the value of the ViewState backed public property.


Hide Time from events in Calendar list or webpart Use below code in content edit webpart or by editing list page in SharePoint designer ...