ANTS Performance Profiler - 6.2

ANTS Performance Profiler

Learning ANTS Performance Profiler - 6.2

Profiling SharePoint

ANTS Performance Profiler can profile managed code that runs on a Microsoft SharePoint server because Microsoft SharePoint 2007 is implemented as an ASP.NET web application.

Please note that SharePoint 2010 is not supported in ANTS Performance Profiler version 6.2. SharePoint 2010 support is included in versions 7.0 and above.

Setting up the Performance Profiler

To profile SharePoint, on the ANTS Performance Profiler Settings dialog box, perform the following steps:

  1. Open Internet Information Server (IIS) Manager and stop the website.
  2. In ANTS Performance Profiler, under Choose application type to profile, click ASP.NET web application (IIS).
  3. Enter the path to the ASP .NET web application that hosts your site collection. The path should be in the following format:
    http://server:port/

    The server is the name of the local server and the port is the TCP port that the web application normally runs on. If the site collection is on the root virtual directory for the site, you must include the trailing slash.

    Note that you enter the path manually, because the drop-down list of available sites does not support SharePoint.

  4. Select the required Profiling mode, SQL and file I/O, and Profile child processes options; see Working with Application Settings.
  5. Select the port on which to profile your application:
    • If you are using IIS 6 or IIS 7, select Unused port and choose a port that is not used by IIS.

      Note that this will not work if your application's code specifically binds to a specific port.

    • If you are using IIS 5, or if you are using IIS 6 or 7 and your application binds to a specific port, select Original port.

      IIS will restart so that the profiler can attach to the port.

      If IIS does not restart correctly, use IIS Manager to stop the website until you have finished profiling.

    The port where the application will be profiled is displayed at the bottom of the ANTS Performance Profiler Settings dialog box.

  6. If required, select Manually specify ASP.NET account details and enter the User name, Password and Domain.

    ANTS Performance Profiler profiles your web application as the Windows Local System user. If the Windows Local System user might not have appropriate permissions to use SharePoint site collection, enter the credentials of a user who does have the required permissions. Note that the user you specify must be an administrator.

  7. If required, change the performance counters to record; see Setting up Charting Options.
  8. Click startprofilingbutton.

sharepoint_iis2

Use your SharePoint 2007 site collection as normal. Any additions that you have coded, such as web parts and lists, will be reflected in the ANTS Performance Profiler results if these objects have been accessed.

During a profiling session you can interact with the profiler whilst your site collection is still being profiled, and obtain results by selecting areas of the timeline.

When you have finished interacting with your web application, click the StopProfilingbuttonsmall Stop Profiling button in ANTS Performance Profiler.

Note that you can only profile SharePoint site collections running on the computer where the profiler is installed.

Troubleshooting SharePoint Profiling

There are two main problems that you may encounter while profiling SharePoint:

  • ANTS Performance Profiler cannot read from the directory which SharePoint writes data to.
  • ANTS Performance Profiler cannot profile SharePoint because of security restrictions in ASP.NET.

ANTS Performance Profiler cannot read from the directory which SharePoint writes data to

The most likely cause of problems while profiling Sharepoint is that ANTS Performance Profiler cannot read from the directory which SharePoint writes data to. To fix this:

  1. Create a temporary directory
  2. If you are not on a sensitive system, allow full read/write access to this temporary directory to all users. If you are on a sensitive system, ensuring that the local system account has read/write access should suffice.
  3. Use Control Panel to add a new environment variable. The variable must be called RGIISTEMP and the value is the path to the temporary directory you just created.

For more information, see Chris Allen's blog post, 'Profiling SharePoint with ANTS Performance Profiler 5.2' (This blog post is also valid for ANTS Performance Profiler 6.2.)

ANTS Performance Profiler cannot profile SharePoint because of security restrictions in ASP.NET

Security features in ASP.NET may cause problems on some systems. To fix this:

  1. Obtain the required information.
  2. Grant permissions.
  3. Ensure that compilation with be in DEBUG configuration.
  4. Copy PDBs and web part DLLs to the app_bin directory.

1. Obtain the required information

Before you start, you need to know the following details for the site collection which you are profiling:

  • the URL
  • the TCP port
  • the name of the primary site collection administrator
  • the primary site collection administrator's password

To find the name of the primary site collection administrator:

  1. Open the SharePoint Central Administration website using the Start menu item.
  2. Click the Application Management tab.
  3. Under the SharePoint Site Management heading, click Site Collection Administrators.
  4. Select the name of the site collection hosting your web part from the dropdown list.
  5. Make a note of the account set in the Primary Site Collection Administrator box.

amp_sharepoint_admin.gif

2. Grant permissions

The primary site collection administrator must have permission to launch an IIS worker process. To grant this permission:

  1. Open Administrative Tools then open Local Security Policy.
  2. Under Local Policies, click User Rights Assignment.
  3. Double-click Act as part of the operating system and add the primary site collection administrator's account.
  4. In the same way, double-click Impersonate a client after authentication and add the primary site collection administrator's account.
  5. Open a command prompt and run
    gpupdate /force
    to enforce the new settings.
  6. Open Administrative Tools and go to Computer Management.
  7. Under Local Users and Groups, open Users.
  8. Double-click the primary site collection administrator's account and open the Member Of tab.
  9. Add the Administrators group.

MP_sharepoint_useradmin

The ANTS Performance Profiler 6 Service must use the primary site collection administrator's account when it starts. To configure this:

  1. Open Administrative Tools then open Services.
  2. Double-click ANTS Performance Profiler 6.2 Service.
  3. Click the Log On tab.
  4. Select This Account and enter the primary site collection administrator's username and password.
  5. Click OK.
  6. If the status of ANTS Performance Profiler 6 Service is Started, right-click the service and click Restart.

amp_

3a. Ensure that compilation will be in DEBUG configuration (IIS 7)

(Instructions for IIS 6 are below)

To set the application in DEBUG configuration in IIS 7:

  1. Load IIS Manager.
  2. Click the web application you want to profile.
  3. Click the .NET Compilation option.
  4. Under the Behavior group, set Debug to True.

Continue reading the isntructions in 4. Copy PDBs and web part DLLs to the app_bin directory, below.

3b. Ensure that compilation will be in DEBUG configuration (IIS 6)

To profile a SharePoint collection, the ASP .NET compilation must be done in DEBUG configuration. This will allow ANTS Performance Profiler to locate the source code for any web parts or other extensions you have written for the site collection. DEBUG configuration will also relax some unmanaged code restrictions that prevent profiling and stop the site from timing out.

To set DEBUG configuration, you must know the physical path to the root of the site collection website.

To find this path:

  1. Open Administrative Tools.
  2. Open Internet Information Server (IIS) Manager.
  3. Right-click the website containing the site collection then click Properties.
  4. Open the Home Directory tab.
  5. Note the path in the Local path box.

You must now locate and edit the web.config file for the site collection using an XML editor.

  1. Use Windows Explorer to navigate to the site collection root's physical path.
  2. Right-click the web.config file.
  3. Open the web.config file using Notepad. Search for the text debug.
  4. Change
    <compilation batch="false" debug="false">
    to
    <compilation batch="false" debug="true">
    and save the file.

MP_debug_true.gif

4. Copy PDBs and web part DLLs to the app_bin directory

If you want to be able to filter out all methods except the ones run by your code when viewing the results, you must copy the relevant files into the site's app_bin directory. To do this:

  1. Copy all PDB files and any web part DLLs used by your site to the Clipboard.
  2. Use Windows Explorer to navigate to the site collection root's physical path.
  3. Open the app_bin directory.
  4. Paste all PDB files and any web part DLLs used by your site into this directory.

Continue following the instructions in Setting up the Performance Profiler, above.

Was this article helpful?

Search support
Forums

ANTS Performance Profiler

all products