Search This Blog

Saturday, March 15, 2014

SharePoint farm with multiple WFEs

SharePoint farm with multiple WFEs (web front ends) and then wondered later which server you were hitting? .
TO CREATE IMAGE ON WEF#1, WEF#2 SERVER
Go WEF#1 server Create one image on paint software and save it (loadtest.jpg) save path location here C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES
 Go WEF#2 server Create one image on paint software and save with different pixels (loadtest.jpg) save path location here C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES
Note: Image name save as Same name on both server
Go to http://testn.site.com site navigate Site Action-> View All Site Content
Next ->Click on SiteAssest
Next -> Create one folder called LoadTest
Next-> Download JQuery(jquery-1.10.2.min.js) support files and uploaded the LoadTest Folder.
Next->Create one notepad file and below JavaScript file and save it local machine desktop name as LoadBalance.txt and upload it LoadTest folder.
<script type="text/javascript" src="../SiteAssets/LoadTest/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
function Loadtest(){
var len=$("#txtNumber").val();
if (len!= 0) {
$("#tbl").append("<tr>");
for (var i = 0; i < len; i++) {
$("#tbl").append("<td> <img src='https://testsite/_layouts/images/ loadtest.jpg '> </td>");
}
$("#tbl").append("</tr>");
}
else
{
alert("Please enter value");
$("#txtNumber").focus();
}
}
</script>
<input id="txtNumber" type="Text"/>
<input type="Button" onclick="Loadtest();" value="LoadImage"/>
<table id="tbl"></table>

Next Go to ->SiteAction->ViewAllSiteContent
Next-> Click ->Create-> Select: Page Section->WebPartPage->create -> test.aspx under sitePages.  
Next->click -> test ->
Next -> Site Action -> Edit Page
Next add one Content Editor WebPart and Link below path:
/SiteAssets/LoadTest/LoadBalance.txt
Next apply and Save Page.
Next click LoadImage button see the corresponding image in loding corresponding server.