Thursday, December 9, 2010

High Memory and CPU Usage by fixmlindex.exe FAST 2010 for SharePoint

 

I had the FAST Search server 2010, SharePoint 2010 and SQL Server 2008 R2 installed on a single demo machine. Though this is not something which Microsoft recommends, it was very important when you visit clients for showing a demo showcasing the capacity of FAST.

When I tried to verify the memory and CPU consumption in the Task Manager, it did not took a long time to understand that the SQL Server and a FAST Search Server exe was one of the major culprits in bringing the system down on many of the occasions.

It appeared that continuously adding managed properties continuously across all the demos was leading to a continuous update in the index for the properties, which led to a high memory and CPU usage.

To overcome this, you should perform the following steps:

  1. Perform complete schema update
  2. In the FAST powershell run the command “nctrl stop”
  3. delete the file  “etc\config_data\Schema\webcluster\summaryclasses.xml”
  4. In the FAST powershell run the command “nctrl start”

This should handle most of the issues  related with high CPU and memory usage.

Tuesday, December 7, 2010

Custom Login Page for Forms based authentication

While migrating the SharePoint 2007 sites for one of the clients running on Forms based authentication, I had to break my head on making the default login page to work in the migrated SharePoint 2010 environment.
On a deep dive into the SharePoint 2007 Login Page and SharePoint 2010 Login Page  for Forms based authentication in the Fiddler, I found out that the SharePoint 2007 Login page generates a cookie ASPXAUTH which is different from the SharePoint 2010 environment which generates the FedAuth cookie.
To dig more deeper and understand things better, when I opened the default.aspx, I could see that it inherited from the FormsSignInPage rather than the LayoutsPageBase.
With all this, I decided to create a New Custom Login Page for My Requirement using Visual Studio 2010.

CUSTOM LOGIN PAGE

  • Open the Visual Studio 2010 and create an Empty SharePoint Project.
 image
  • In the Configuration Wizard, Select the option of “Deploy as FARM Solution”, because we will be using the Application Pages and deploying the solution to the SharePoint 14 hive folder. The Sandboxed Solutions cannot be deployed on the SharePoint 14 hive folder.
image
  • Once the solution is created, right click on the solution and click to add an Application page which will be used as a Login page in my application.
imagenc
  • If you plan to use any images on the login page control, the add the mapped image folder by right click on the solution and click “Add” and then select “SharePoint Mapped Images Folder”
image
  • Add a reference of the Microsoft.SharePoint.IdentityModel.dll
For adding the reference of the Microsoft.SharePoint.IdentityModel dll, navigate to the c:\Windows\Assembly\GAC_MSIL folder.
Select the folder “Microsoft. SharePoint.IdentityModel”
once the folder is opened, you will find a version and guid mapped folder,
once you open the folder, you will see the dll from which you need to add a reference to your application.

image

  • Once the reference of the dll has been added into the solution, we need to add a Reference of the Microsoft.SharePoint.IdentityModel in the aspx page as a directive.
<%@ Assembly Name="Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
  • Also Add the default Login control
<asp:Login ID="signInControl" FailureText="<%$Resources:wss,login_FailureText%>"
        runat="server" Width="100%" DisplayRememberMe="false" />

Custom Login Logic
If you want to add the Custom Login logic into your control, like, you need to perform some additional activities like sending mails to the user, generating notification alerts for the user, then you will need to place your custom logic in the code behind pages.
  • Add the directive using Microsoft.SharePoint.IdentityModel.Pages;
  • open the code behind page,Login.aspx.cs, and change the default parent class from LayoutsPageBase to FormsSignInPage.

Once all this has been performed, the development of the login page is complete and we need to configure the Login page in the central administration.

CONFIGURE THE CUSTOM LOGIN PAGE IN CENTRAL ADMINISTRATION

  • Open the central administration, click on the “Manage Web Applications”
  • select your web application and then click on the “Authentication Providers” button.
image
  • Select the zone on which you want to set this Custom login page and then go to the Sign In Page URL and set the Custom Sign In Page with the page just created.
image
  • Once all this has been performed, you will be able to see the Customized Login Page.
image