Tag: iis

How Popular are Microsoft IIS Servers Around the World?

From Port 80:

Microsoft’s IIS web servers have been among the most popular in the world for years, historically battling Apache, and the increasingly popular nginx, for supremacy. IIS remains strong in many market segments throughout the world, and with data gathered by W3Tech, we’ve compiled some breakdowns of IIS use around the world. Numbers are a representation of IIS use per top-level domain (TLD).

How Popular are Microsoft IIS Servers Around the World?
Below is an enlarged view of European IIS usage. This bar graph is in order of IIS popularity among top level European domains.
IIS Usage in European Countries
Below, IIS usage is broken down by generic top-level domains. This area is strong with governmental domains like .gov and .mil, which were both over 50% for IIS usage. IIS also proves popular with educational organization, accounting for nearly half of all .edu domains.
IIS Usage in Generic Top Level Domains
While IIS was reportedly passed by nginx for overall popularity earlier this year, it maintains a strong hold in several countries and industries, especially at the governmental level. This should be no surprise because as we have seen IIS remains popular within many corporations in the Fortune 1000

.

Data source: W3Techs http://w3techs.com/technologies/breakdown/ws-microsoftiis/top_level_domain

Using PAL to Analyze SharePoint Performance Monitor Counters

Ever have a performance problem, but don’t know what performance counters to collect or how to analyze them? The PAL (Performance Analysis of Logs) tool is a powerful tool that reads in a performance monitor counter log and analyzes it using known thresholds.

Features

-Thresholds files for most of the major Microsoft products such as IIS, MOSS, SQL Server, BizTalk, Exchange, and Active Directory.
-An easy to use GUI interface which makes creating batch files for the PAL.ps1 script.
-A GUI editor for creating or editing your own threshold files.
-Creates an HTML based report for ease of copy/pasting into other applications.
-Analyzes performance counter logs for thresholds using thresholds that change their criteria based on the computer’s role or hardware specs.

Part 1 – Set Up Pal

1. Go to http://pal.codeplex.com/ and download the latest version of PAL onto your server.
2. Install the program via the Setup.exe file

Part 2 – Set Up Performance Counters

1. Open up the Performance Monitor snap-in (Start -> Run -> perfmon)
2. Expand the “Monitoring Tools” option and Right Click on “Performance Monitor” -> “New” -> “Data Collector Set“
3. Give the data collector set a name and click on Next
4. Give the location where you want to save the Perfmon Logs and click on Next
5. Here you can provide the Run As user of leave that as the Default user
6. Select the option “Save and Close” and click on Finish
7. Then go back to the Perfmon snap-in main window and you should see a Data Collector set with the same name that you created under Data Collector Sets -> User Defined
8. Click on the Data Collector Set and on the right hand pane, you should see a System Monitor Log Performance Counter. Right click on it and click on properties.
9. Under the Performance Counters tab, add the following SharePoint-specific performance counters required for your data collection. You can for some counters isolate the counters to specific web applications in order to narrow down things a bit:

11. Set the log format as binary, and the sample collection interval time to 5 seconds.
12. Under the File tab specify the file format name and logging properties for the file.

Part 3 – Process Your Performance Monitor Output Logs with PAL

1. Open up PAL from the Windows Start Menu:

2. The welcome page :

3. Select the .BLG binary PerfMon you collected earlier:

4. Choose the SharePoint 2010 Threshold File:

5. Answer the Questions! Select your relevant info including number of CPUs and Total Memory (PAL doesn’t detect automatically):

6. Choose your Output Options:

7. Select your file output variables and path location:

8. View the queue:

9. Execute!

10. Analysis in progress:

11. After it’s done processing, PAL outputs a beautiful, prioritized HTML page breaking down your performance pains and referencing solutions to fix them. By Default it saves it to PAL Reports:

This is a vastly useful tool which can similarly be jigged to work to turn the piles of data output by PerfMon into useful, actionable intelligencefor much more than just SharePoint. Thanks to Clint Huffman for creating and maintaining this!

SharePoint 2007 IIS Traffic Analysis

I recently needed to run down some performance/usage statistics on a SP 2007 farm, and found the following Feb. 2008 blog post. Unfortunately, the SQL scripts for building the tables and procedures were missing. Archive.org to the rescue and I revived the SQL from the dead. Below is the full blog post including the necessary SQL scripts:

**Note: I also corrected a typo, the column names IISReports.IISLOGSTATS and IISReports.loggingdir were incorrectly referenced as IISReports..IISLOGSTATS and IISReports.loggingdir in the scripts.

Original Post: http://blogs.technet.com/b/corybu/archive/2008/02/26/sharepoint-iis-traffic-analysis.aspx

Internally we have experienced situations where internal users have built tools or solutions which have negatively affected performance for our SharePoint users. This can be done in different ways such as Setting up multiple MOSS Farms to crawl our customer facing front ends at high performance setting or creating a custom application to execute against various MOSS web services without throttling the application in any way. From that need spawned a little tool we created with the help of log parser J The following is an example of how you could setup a scheduled task to notify you on number of Hits against your moss environments and how much bandwidth each user is consuming.

Please remember to never perform any of the following on production without first trying it out in a test environment, all items here are merely examples of how you ‘could’ perform such an action.

Skills and Items required / assumed to perform this task.

· A SQL 2005 server with XP_CMDSHELL enabled
· Read Permissions for SQL Server Account Granted to the IIS Log directory of your SharePoint Servers
· Access to create and modify databases on your SQL Server
· Logparser 2.2 Installed on your SQL Server
· Good Understanding of SQL Server and TSQL
· Good Understanding of IIS
· Access to all customer Facing SharePoint Front Ends
· Good Understanding of SharePoint

Step 1: Create a reporting database on your SQL Server, for the benefit of this blog entry we will call this database IISReports. Set that reporting database to autogrow for the data file and log file.

Step 2: Grant read permissions to all IIS log directories where your Web application Logs are stored on all servers you wish to report on.

Example: %WINDIR%System32Logfilesex080218.log For better performance internally we place our IIS Log files on a serperate drive

Step 3: Install Logparser 2.2 to a directory on your sql server(make note of this directory) For the purpose of this entry we will call this c:templogparser.exe

Logparser 2.2 can be downloaded @ http://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx

Step 4: Create Tables that we will use to pull in and manipulate the data

Click Here to open example Script

USE [IISReports]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[IISLOGSTATS](
	[TotalHits] [bigint] NULL,
	[LogFilename] [varchar](255) NULL,
	[csHost] [varchar](255) NULL,
	[csUsername] [varchar](255) NULL,
	[cIp] [varchar](255) NULL,
	[ServerToClientBytes] [bigint] NULL,
	[ClientToServerBytes] [bigint] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF



USE [IISReports]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[loggingdir](
	[IISDir] [nvarchar](100) NULL
) ON [PRIMARY]

Step 5: execute the Create script for the stored procedure that will be used to pull the data.

Click Here to Open example Script – Make sure to read the /**notes**/ as they direct you to make changes to the script to cater to your environment.

use [IISReports]
go
create procedure [dbo].[IISLOGTracking]
as
truncate table IISReports.loggingdir

/** standard query that uses log parser to grab the current IISLOG file off of each web front end
Make sure to change frontend#e$wwwlog*.log  to the actual UNC path of each of your IIS log directories for each front end **/
declare 
@path nvarchar(255),
@path2 nvarchar(255),
@path3 nvarchar(255),
@path4 nvarchar(255),

select @path =  'xp_cmdshell ''C:Program Files (x86)Log Parser 2.2logparser.exe "select top 1 path from Frontend1e$wwwlog*.log order by path desc" -i:fs -q:on'''
select @path2 =  'xp_cmdshell ''C:Program Files (x86)Log Parser 2.2logparser.exe "select top 1 path from Frontend2e$wwwlog*.log order by path desc" -i:fs -q:on'''
select @path3 =  'xp_cmdshell ''C:Program Files (x86)Log Parser 2.2logparser.exe "select top 1 path from Frontend3e$wwwlog*.log order by path desc" -i:fs -q:on'''
select @path4 =  'xp_cmdshell ''C:Program Files (x86)Log Parser 2.2logparser.exe "select top 1 path from Frontend4e$wwwlog*.log order by path desc" -i:fs -q:on'''

insert into IISReports.loggingdir exec(@path)
insert into IISReports.loggingdir exec(@path2)
insert into IISReports.loggingdir exec(@path3)
insert into IISReports.loggingdir exec(@path4)

delete IISReports.loggingdir where IISDir is null
truncate table IISReports.iislogstats

/** SQL Cursor that takes the directory path / current days IIS Log and passes it through a cmdshell string 
to execute the logparser query, it then pulls it back to your Sql server.  Make sure to change
-server:ReportingServer to your reporting server.**/ 

declare   
@dirpath as nvarchar(250)  

DECLARE DBCursor CURSOR For  
  Select IISDir 
  From IISReports.loggingdir  
  
OPEN DBCursor  
FETCH NEXT FROM DBCursor into @dirpath
  
WHILE @@FETCH_STATUS =0  
BEGIN  
EXEC  
  ('  
 xp_cmdshell ''c:templogparser.exe "select count(*) as TotalHits, logfilename, cs-host, cs-username, c-ip, sum(sc-bytes) as ServerToClientBytes, sum(cs-bytes) as ClientToServerBytes from ' + @dirpath + ' to IISLOGSTATS Group by cs-host, cs-username, logfilename, c-ip order by TotalHits desc" -i:IISw3c -o:sql -server:ReportingServer -database:IISReports''
')  
 FETCH NEXT FROM DBCursor into @dirpath
END  
CLOSE DBCursor  
DEALLOCATE DBCursor  

/** Code to Email top 20 for Hits/Visits Change <change to your email> to your email at @reciepients line :) **/
declare @tableHTML nvarchar(max);
SET @tableHTML =
    N'<H1>Top 20 for Total Hits</H1>' +
    N'<table border="1">' +
    N'<tr><th>Total Hits</th><th>Logfilename</th>' +
    N'<th>Url Host</th><th>UserName</th><th>IP</th>' +
    N'<th>Bandwidth Used (MB)</th></tr>' +
    CAST ( ( SELECT top 20 td = totalhits,       '',
                    td = logfilename, '',
                    td = cshost, '',
                    td = csusername, '',
                    td = cip, '',
                    td = sum(ServerToClientBytes + ClientToServerBytes)/1024/1024 
				from IISReports.IISLOGSTATS 
					where csusername is not null 
					group by totalhits, logfilename, cshost, cip, csusername order by totalhits desc
              FOR XML PATH('tr'), TYPE 
    ) AS NVARCHAR(MAX) ) +
    N'</table>' ;

EXEC msdb.dbo.sp_send_dbmail    
    @recipients = '<change to your email>',    
    @subject = 'Top 20 Hits',   
    @body = @tableHTML , 
	@body_format = 'HTML';

/** Code to Email top 20 for bandwidth used Change <change to your email> to your email at @reciepients line :)**/
declare @tableHTML2 nvarchar(max);
SET @tableHTML2 =
    N'<H1>Top 20 for BW used</H1>' +
    N'<table border="1">' +
    N'<tr><th>BW Used in MB</th><th>Total Hits</th>' +
    N'<th>Logfile</th><th>Url Host</th><th>Username</th>' +
    N'<th>IP</th></tr>' +
    CAST ( ( SELECT top 20 td = sum(ServerToClientBytes + ClientToServerBytes)/1024/1024,    '',
					td = totalhits,       '',
                    td = logfilename, '',
                    td = cshost, '',
                    td = csusername, '',
                    td = cip
                    
				from IISReports.IISLOGSTATS 
					where csusername is not null 
					group by totalhits, logfilename, cshost, cip, csusername order by sum(ServerToClientBytes + ClientToServerBytes)/1024/1024 desc
              FOR XML PATH('tr'), TYPE 
    ) AS NVARCHAR(MAX) ) +
    N'</table>' ;

EXEC msdb.dbo.sp_send_dbmail    
    @recipients = '<change to your email>',    
    @subject = 'Top 20 Users for Bandwidth',   
    @body = @tableHTML2 , 
	@body_format = 'HTML';

Step 6: If everything has been followed and updated accordingly you can now run the following in SQL.. shortly there after you will receive an email similar to the following