Dec 142014

Regardless of whether you are running Windows Server 2012 on virtual server or physical server, the success of your business depends on having the server run at optimal capacity. To ensure the server delivers uninterrupted service, you have be aware of potential performance issues before they arise.

One of the best methods to analyze the performance of Windows Server 2012 is with Performance Monitor and a User Defined Data Collector. With this tool the identification and analysis of potential performance issues has never been easier. Upon completion, a detailed summary report will be generated providing immediate insight into key aspects of the server’s performance such as Disk IO, CPU, and RAM as well as network utilization. Reading the report summary is simplified further with the use of green, red and yellow icons that call your attention to any irregularities. Additional in depth metrics are contained in collapsible sections of the report below the Summary.

Creating a New Data Collector

To create a new User Defined Data Collector simply open Performance Monitor, right click on User Defined, select Data Collector Set. A wizard will launch to guide you through creating a new Data Collector. Once created the Data Collector will be available to run as frequently as needed. Each time it runs a new report will be created.



The first step will be to enter the name of your report. I usually specify “Performance” somewhere in the name since that is the type of Data Collector I am planning on running. Choosing the default option of Create from the template is recommended. Click on Next to continue.



The next step will be to choose the Data Collector Template that you want to use. I am going to choose System Performance. Click on Next to continue.



Next you will be prompted to choose a path to store the report data. Depending on how long your report runs and how frequently you run it the reports can consume a lot of space. In the event that your server has multiple disk drives, it would be better to select the larger drive for storing the reports.  Click Next to Continue.



Leave <Default> for the Run as: user context. You can change that later if needed. We need to configure some additional settings before running so select Open properties for this data collector set and then click Finish.


Additional Data Collector Properties

Before running your new data collector there are a few properties that you want to double check first.


Setting the Stop Condition

With the properties open, click on the Stop Condition tab so that you can enter a specific period of time for the Data Collector to run. It is important to set a Stop Condition before running otherwise it will continue to run indefinitely until you manually stop it. As I noted earlier not only can the logs can take up disk space but also running a Data Collector for an extended period of time can impact server performance so specifying a Stop Condition is a good idea. For short tests I typically set 20-30 minutes. For longer tests I’ll set 2-3 hours.



Setting a Recurring Schedule

Chances are you may already be aware of a performance problem on your server and need to isolate the analysis window to a specific day or time period. Clicking on the Schedule tab will enable to specify multiple dates and times to run the Data Collector. This could be especially helpful if your server gets busy with after-hours utilization and you’re not available to start the data collector manually.




You can even select a date range to run the data collector on specific days of the week during that period of time.



Once you’ve finished setting the properties of the data collector just right-click on the name to run it manually or wait for the schedule to start it automatically.


Viewing the Summary Report

You will be able to view and analyze the report generated by the Data Collector once it has completed running. If you try to view the report before it has completed you will be notified that the Data Collector is still running. The report is located under the User Defined Reports section of Performance Monitor.



The overall performance of the server is displayed at the top of the report in the Summary. Anything requiring your immediate attention is noted in the Diagnostic Results section. In the picture below we can see that the server clearly needs additional RAM to alleviate the disk paging that is occurring.  The Resource Overview offers an easy to read chart of the server’s core resources of CPU, Network, Disk, and Memory. The status of each of these is indicated with Green, Yellow, or Red icons.



Below the Summary are collapsible sections that offer more detailed insight into the server’s CPU, Network, Disk, and Memory utilization. Here are two examples of the additional data that is available:

CPU Utilization

In the picture below we can see that one IIS worker process was consuming nearly 80% of the server’s CPU utilization. Performing additional analysis with Log Parser on the web site’s web logs would help identify the problems this particular web site is experiencing.



Disk IO

Some cloud server providers will charge overage fees for excessive disk IO so it’s important to know what’s happening there. In the Disk summary there a helpful report that shows exactly what files on your server are consuming the most IO. This report is aptly named Files Causing Most Disk IOs. In the picture below we can see that pagefile.sys is causing a lot of disk IO. This is a good indication that the server could benefit from additional RAM thereby reducing the amount of disk paging that is occurring.


Viewing the Data Counters

In addition to reading the data collector report you also have the ability to view the raw counter data. From this view you can select all the counters that were collecting data or only a few and play back the utilization as it occurred.



In Summary

Windows Server 2012 offers several tools for analyzing your server’s performance. The Performance Monitor Data Collector offers comprehensive insight into resource utilization and makes it easy to quickly identify performance bottlenecks. Thanks for reading.

Nov 292014

When your Windows server is low on space or runs out of space entirely you need to quickly identify where the disk space is being utilized and free up space. Low disk space or worse yet no disk space can have a negative impact on your server’s performance.  Knowing the paths to a few folders that typically eat up space such as web logs isn’t enough when you need to free up space ‘now’. In this situation you need a graphical tool that can quickly analyze an entire disk drive or even multiple drives and show you how the server’s space is being utilized. Fortunately for Windows server admins JDiskReport and WinDirStat are two such tools and better still they are both free.


Using JDiskReport

JDiskReport is a free graphical disk space tool from Unlike some of those other free tools companies provide that require you to register your product before it works or that you have to pay to unlock features, JDisk is ready to use as soon as it’s installed and it’s feature complete. Installation of JDisk is straight forward and quite simple.

Before you install JDisk you should know that it requires the Java Runtime to run. If the Java Runtime is missing and you install JDisk, it prompt you to locate the path to the Java Runtime. Once you’ve downloaded Jdisk to your server just launch the installation wizard. The only additional step of the wizard will be to specify the path where you want it to be installed.



Once installation has completed you will be presented with the default starting screen. Any previous paths that you’ve analyzed will be displayed for added convenience. You can select the entire disk drive or a specific folder on the server.



Unless I have a specific folder in mind I typically pick the entire disk drive. Within a few minutes, after initiating a directory scan, you will see a detailed analysis of the server’s disk space utilization. This report is more than just a pretty picture. Not only can you can click on any folder of the navigation tree to drill down more but you can also click on any part of the pie chart to see subdirectories.



In the picture above we can see that the Windows folder is using the most space but that is to be expected on a C: drive. Looking more closely I can see that on this server C:\temp is using over 9 GB and that’s unusual so there’s probably some files in there I can delete which will free up valuable space. In addition to the colorful chart you can also get a detailed file list and sort that according to size. In the picture below we can see a more detailed look at C:\temp.


Within minutes of running the scan, JDisk has helped me find several large files which can be deleted.


Using WinDirStat

WinDirStat can be downloaded from and is available in 12 different languages. It offers some interesting features such as an option to delete files and a color coded treemap  as well as disk space utilization based on file type. Installing WinDirStat is just as simple as installing Jdisk. Upon launching the wizard you’ll be prompted to accept the GNU GPL. After that you just need to choose the features and then pick the installation path.



When the program first opens, it will display all of the disk drives available for analysis. If your server happens to have any network drives mapped, they will also be displayed. Here you have the option to scan all the drives on the server, just one drive, or a specific folder.



Scanning the disk drive completes quickly however it’s hard to say whether WinDirStat is faster or slower than JDisk. The speed of both programs will ultimately depend on how much data is being analyzed and the server hardware configuration  such as processor speed and disk drive speed. Once it completes you are presented with a detailed analysis of the disk space utilization. Clicking on any folder in the tree view enables you to drill down in the directory tree.



From the application menu you can toggle showing the utilization by file type and see the treemap. Although the treemap and file type analysis are helpful, I prefer to just use the directory list because when I’m working on a server that’s running out of disk space, I need to get it resolved quickly.



In Summary

Having enough free disk space is a necessity for Windows servers to perform optimally.  Graphical tools like JDiskReport and WinDirStat make it easy to identify where your server’s disk space is being consumed. Both are capable programs and work quickly to analyze disk space utilization. If I had to choose only one, I could pick WinDirStat because it doesn’t require any additional software to operate. Thanks for reading.

Nov 072014

When it comes to improving Windows server performance, most sysadmins focus on hardware such as adding CPUs or RAM. However, low disk space can also impact performance sometimes even causing critical processes such as backups to fail. Fortunately there are quite a few places to check on a Windows server to free up additional disk space.  Some paces to check are obvious such as cleaning up log files while other paces are not as obvious such as finding system temp files.

How to See System Files

Before searching for additional space you need to ensure that you Windows Explorer will display hidden system files and file extensions. To confirm you can see these open Windows Explorer and go to Folder & Search Options.



Click on the View tab and select Show hidden files, folders, and drives. Uncheck Hide protected operating system files and Hide extensions for known file types.  Making these changes will allow you to see all the files on the server including system files and folders which could be taking up unnecessary space. Click OK to close the window.

Before deleting anything always double check that you really don’t need the files any more and it’s safe to delete. Here are the top places that I check when I need to free up disk space on a Windows server.

1. Empty Recycle Bin

Cleaning up the recycle bin is most likely the easiest way to purge files unnecessarily taking up space. When you need to quickly clean up space this is the first place to check. It is surprising how much space can accumulate over time. Every disk volume on the server has a $recycle.bin folder. As mentioned above you won’t be able to see it until you enable viewing system folders. In the picture below you can see there’s plenty of deleted files waiting to be purged. Just select all the folders and right-click to delete them.




2. Compress IIS Log Files

The next thing I do when I need to free up disk space is to compress the IIS site log files. The default path to these files is %SystemDrive%\inetpub\logs\LogFiles. However, I prefer to redirect that path to something easier to find at the root of the disk drive such as C:\wwwlogs. If the server has multiple drives I will store them on the largest drive. Unless you disable your site logs they will automatically grow until the disk drive has filled up or they are removed or they are deleted. Enabling Windows file compression on the IIS logs directory tree will save a considerable amount of disk space.



To enable Windows file compression, just right-click on logs folder and select Properties. Click the Advanced button and as shown in the picture above and select Compress contents to save disk space. Click OK to close the window. Depending on how much content you have in the directory tree it may take several minutes to complete.



The picture above is from an IIS logs folder where I enabled compression and as you can see it saved 62% of the space being utilized by the log files. You can squeeze even more free space from your IIS log files by zipping them with an archiving program. In a recent walkthrough of mine I show how to manage IIS logs with GZipStream.


3. Compress SQL Server Backups


The SQL Server backup folder is another great place to check when you need to free up some disk space. You can use the steps above to apply Windows file compression and as well zipping the files to free up additional disk space. In the photo below the SQL Server backup folder is using 1.8 GB of space without any compression.


After applying compression to this folder I was able to save approximately 60% of the disk space used by the backups. By zipping the files as well can you save can even more space. Depending on your particular business needs, you can also save additional disk space by limiting number of backups SQL Server stores on the server. This can be configured with a SQL Server Maintenance Plan.


4. Cleanup Performance Monitor Reports

Windows Performance Monitor is an invaluable tool to analyze performance on a Widows server. Within minutes, one can easily configure a Data Collector to get deep insights on CPU, RAM, Network IO, and Disk IO. However, this convenience can also lead to disk space being needlessly consumed when you have forgotten about the reports days or weeks after the analysis has completed. This will be even more apparent if someone forgets to set a Stop Condition on the Data Collector and leaves it running for days.


The default path for the logs is usually C:\PerfLogs. The report path is also clearly shown in the Data Collector properties. Once your analysis has completed and you’ve reviewed the reports you can delete them. Applying Windows file compression to the reports folder as shown above will also help save disk space.


5. Cleanup Windows Error Reports

Windows Error Reporting is an exceptional tool for identifying issues on your server. Unless you delete the logs or disable the feature they will accumulate over time. The default path to WER reports is C:\ProgramData\Microsoft\Windows\WER and there are two sub-directories below it. You can delete the files in the folders but you should leave the 2 folders in place. This is another great place to apply Windows file compression to save more space.




6. Cleanup Windows Temp Files

There are several paths on Windows server’s that are used temporarily when installing updates or new programs. In many cases Windows will automatically delete these files after the installation has completed. However sometimes you’ll need to manually delete them yourself. One such folder is C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp. In the picture below I was able to free up nearly 1 GB by deleting Malware Protection updates that had not been properly removed after they were installed.


Here are some other possible locations to look for temporary files that can be removed:

  • C:\temp
  • C:\Users\Default\AppData\Local\Temp
  • %localappdata%\Microsoft\Windows\Temporary Internet Files
  • %localappdata%\Microsoft\Windows\Explorer
  • %windir%\ServiceProfiles\LocalService\AppData\Local\Temp


7. Windows Disk Cleanup Tool

Trying to remember all the paths to temporary files can be a daunting challenge for any sysadmin. Fortunately Microsoft recognized this as well. On Windows Server 2008 R2 and Windows Server 2012 or later,  you can get a Disk Cleanup tool like the one on the desktop versions of Windows. However, to take advantage of this you need to install the Desktop Experience feature which is available using the Server Manager’s Add Features Wizard. Just check the feature and then complete the wizard.



After the server has been installed you can access the Disk Cleanup tool from the Control Panel. You will have a convenient way to clean up different types of temporary files including Windows Update files and Windows Error Reporting files.



This tool is very helpful with cleaning up disk space. However, you should be aware that there will be some additional programs installed along with the Disk Cleanup tool which you may not want on your server such as Media Player. Here is a complete list of the programs that are installed with the Desktop Experience.


8. Windows Server 2008

All of the options listed above will also work on Windows Server 2008 systems however specifically on Windows Server 2008 SP2 servers you can make the service pack permanent and free up space by running the following command which should free up nearly 1GB of disk space on the server:

  • compcln.exe /VERBOSE:C:\temp\compcln.txt


9. Windows Server 2003

Windows Server 2003 “end of life” is July 14, 2015. If you haven’t started migration plans for legacy systems on that platform then you need to start planning for it asap. A great place to clean up space on Windows Server 2003 is to delete the hotfix uninstall files. Imagine my surprise when I logged into the server below to work on a low disk space situation and I found over 1 GB of these legacy files going back to 2011. There are also files in the C:\windows\$hf_mig$ folder that can be cleaned up. However, It’s always a good idea to wait at least a week or two before deleting these files in case you need to rollback one of the hotfixes.




One additional way to free up space would be to create a symbolic link from one directory to another on a larger disk drive. Mark Russinovich’s free Junction tool makes it very easy to do this however you have to be careful when doing this or you can inadvertently cause problems for yourself. Be sure to make a backup before using it the first time.

In Summary

Having your Windows server run out of space can cause serious performance issues as well as prevent important backup processes from running. I covered several great places to check on a Windows server when you need to free up space. Always confirm that files are safe to delete before you delete them. Thanks for reading.

Dec 272013

Thanks to Microsoft’s Web Platform Installer (Web PI) installing IIS has never been so easy. Before using Web PI to install IIS became available,  you had to use the Server Manager to install the Web Server (IIS) role and then select various Role Services that you need to be enabled. Depending on your level of expertise this could be a challenging task with lots scrolling back and forth and click upon click to get things just right,  but now you can have IIS deployed with just 3 clicks of your mouse.

Install Web PI

If you’re not familiar with the Web PI, it is a powerful tool that can be used to install not only IIS but also SQL Server Express, Visual Web Developer, Express, PHP, WordPress, Umbraco, and many other 3rd party applications from the Windows Web Application Gallery. If you haven’t already done so first Download Web PI and install it. It’s free and has a small footprint of only 2 MB.


Select IIS Recommended Configuration

Once Web PI has been installed just launch the program . It will open to the Spotlight tab so just click on the Products tab and click Add next to IIS Recommended Configuration. If you don’t see it in the opening list just search for it. All you need to do after this is just click Install at the bottom of the window.




You may be curious as to what options are installed with the IIS Recommended Configuration. Here is what will be installed:

  • Static Content
  • Default Document
  • Directory Browsing
  • HTTP Errors
  • HTTP Logging
  • Logging Tools
  • Request Monitor
  • .NET Extensibility
  • Request Filtering
  • Static Content Compression
  • ISAPI Extensions
  • ISAPI Filters
  • WAS Process Model
  • Management Console
  • WAS Configuration API
  • WAS .NET Environment
  • .NET 4.5 Extended with ASP.NET for Windows 8
  • .NET 3.5 for Windows 8

Before the installation starts you need to accept the license terms so just click I Accept.



The installation will run for a few minutes installing the essential features for IIS to work properly.



Once Web PI has completed installing IIS just click Finish.



Using IIS Manager

Your server is now ready for hosting web sites. Open IIS Manager and you’ll see the Default web site has been configured.



When you browse http://localhost you’ll see the familiar IIS Start Page.


This page is named iisstart.htm and appears in the Default Documents list above default.aspx so once you upload your web site files be sure to delete this page.

Next Steps?

Now that you have IIS installed what’s next? Well you’ll want to go back to Web PI and at least install FTP Publishing. Once you have FTP Publishing installed you want to look into configuring FTP User Isolation as well as using FTP over SSL for greater security when transferring content to and from your server. You may also want to look at installing Url Rewrite 2.0 from Web PI. Url Rewrite offers many ways to rewrite urls for SEO and perform 301 redirects as well as blocking page requests.


The Web Platform Installer (Web PI) is a powerful tool for deploying a wide variety of 3rd party applications such as WordPress and other popular CMS products but it can also be used to install IIS or even SQL Server Express on your server. The Web PI offers  unparalleled ease and convenience with installing applications on Windows servers. Thanks for reading.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
Oct 072013

When you need quick analysis of your traffic logs you won’t find an better tool than Microsoft’s free Log Parser. With Log Parser you can read a variety of log files including the Registry and Windows event logs. It’s ease of use comes from using SQL queries against your log file. You can get your data even faster by using multiple log parser queries in a batch file.


The other day I was helping someone who needed some “top 10” data from their site’s log. Since I had these in my trusty batch file I could provide the text reports within seconds. However, I like to offer a little more pizzazz when possible so this time I decided use Log Parser’s native charting capability to output the results with some nice charts.  As the saying goes a picture is worth a thousand words.

Here’s the query I used to create the chart above:

logparser.exe -i:iisw3c "select top 10 cs-uri-stem, count(*)  into top10requests.gif 
from <file> group by cs-uri-stem order by count(*) desc" 
-o:CHART -chartType:pieexploded3d -categories:off -chartTitle:"Top 10 Requests"


Installing Office Web Components

Charting is a native feature of Log Parser however there is a dependency for Office 2003 Add-in: Office Web Components. Depending on where you are running Log Parser the first time you try to output your query to a chart you may see this error message:

Error creating output format “CHART”: This output format requires a licensed Microsoft Office Chart Web Component to be installed on the local machine

If you didn’t see the error above then you’re all set but if you saw the error then it will be necessary to install the Office Web Components before you can start outputting charts. Once you’ve downloaded the file just accept the License Agreement and click Install.


The installation runs quickly. Click OK to close the window.



Example Log Parser Reports with Charts

Now you’re ready to start creating some colorful charts. The most useful parameters in my opinion are –chartType, –chartTitle, –categories, –values, and –legend. There are some 20+ chart types that you can choose from including:  Pie, PieExploded, PieExlpoded3D, LineStacked, Line3D, BarClustered, ColumnClustered, Smooothline. The default chart type is Line.  To see all the possible chart options run this simple command:

LogParser -h -o:CHART

To take your charts to the highest level of customization you can use an external configuration script with Jscript or VBscript . Take a look at the MSDN ChartSpace Object Model documentation for more information.

Here are a few different charts with various options.


logparser.exe -i:iisw3c "select top 10 cs-uri-stem, count(*)  into top10requests.gif 
from x.log group by cs-uri-stem order by count(*) desc" 
-o:CHART -chartType:pieexploded3d -categories:off -chartTitle:"Top 10 Requests"




logparser.exe -i:iisw3c "select top 10 sc-status, count(*)  into top10errorcodes.gif 
from x.log group by sc-status having sc-status not in ('200') order by count(*) desc" 
-o:CHART -chartType:column3d -categories:on -values:on -chartTitle:"Top Status Codes"




logparser.exe -i:iisw3c "select top 10 cs-uri-stem, count(*)  into top10_404.gif 
from x.log group by cs-uri-stem, sc-status having sc-status in ('404') order by count(*) desc" 
-o:CHART -chartType:BarClustered3D -values:on -categories:on -chartTitle:"Top 10 404 Status"



logparser.exe -i:iisw3c "select quantize(time, 60) as TimeGenerated, count(*) as Hits into 
hitsperminute.gif from %1 group by TimeGenerated" -o:chart -chartType:Line –chartTitle:"Hits per Minute"






logparser.exe -i:iisw3c "SELECT TOP 10 cs-uri-stem AS RequestedFile, COUNT(*) AS TotalHits, 
MAX(time-taken) AS MaxTime, AVG(time-taken) AS AvgTime into slow.gif from x.log 
where EXTRACT_FILENAME(cs-uri-stem) not in('%begin%') GROUP BY cs-uri-stem ORDER BY MaxTime, TotalHits DESC" 
-o:CHART -chartType:barclustered3d -values:off -categories:on -chartTitle:"Top 10 Slowest Requests"


In Summary

Microsoft’s Log Parser is a powerful tool for log file analysis. You can use it to analyze text files, csv files, Window’s event logs and even the Windows Registry.  You can make boring reports come alive with colorful charts.  There is a dependency on Office Web Components for charting to work but that is easily solved. Thanks for reading.

Sep 152012

If your web site is hosted on a dedicated server (cloud or physical) then chances are you have some internal processes which need to happen on a recurring basis. The Windows Task Scheduler is a wonderful built-in tool that fulfills this need.  The location of this program has changed from Windows Server 2003 to Windows Server 2008. With Windows Server 2003 it was located in the Control Panel. With Windows Server 2008 it is located in Administrative Tools.

With the Windows Task Scheduler you can run any program on the server including custom scripts at any time with any recurring frequency. So this great news for system admins but what happens if you’re a web developer and you designed an admin page on your site to perform some internal housekeeping which runs when the page is loaded? As you can imagine you don’t want to sit at your desk all day hitting the refresh button.

So here’s were the power of Windows Task Scheduler comes into view. We just need to create a new scheduled task to visit the web site. Well unfortunately this is not possible. Task scheduler is not able to browse sites. However, that would be a cool feature for a future release.  So are we done before we’ve started? What could be used to open a web site url that we could then in-turn schedule as a task? Well look no further than Microsoft’s XMLHTTP object. I always say “there’s no school like old school” and in this case it is absolutely true. 

The following vbscript is all we need to open the web site url programmatically.  

       On Error Resume Next

Dim objRequest

Set objRequest = CreateObject("Microsoft.XMLHTTP")
URL = "" "GET", URL , false
Set objRequest = Nothing

Just cut and paste the snippet above into a simple .vbs text file on your server and it will be ready to run. If you run it manually it won’t open a browser but the request is completed. To know it works you just need to check your web site logs. With this bit of code we have identified a way to programmatically call web site url from within our server without having to be logged into the server.  So looking back at our original “task” we now have all the pieces in place to get the job done. 

The next step is to just configure Windows Task scheduler and here again Microsoft makes it easy for us. When you open Task Scheduler on the right side of your screen just click “Create Basic Task” and the Create Basic Task Wizard will launch. Just follow the steps and complete the wizard.

You will be prompted to choose the program you want to run. Use the menu to find the .vbs file you created earlier.

After you complete the wizard your task will be ready to run based on the schedule you picked during the wizard. However in some cases you may want your task to run more frequently than once per day. So using the advanced properties you can choose to repeat the task as frequently as every 5 minutes forever.

As I mentioned above you can confirm it works by checking the www logs for your site. Using the powerful command findstr as shown below I can pull out just the requests I want for my test page:

findstr /S /I /P /c:"GET /testme.htm" C:\wwwlogs\W3SVC1\u_ex120915.log >testme.txt

Here are the results which clearly show the scheduled task is working as expected hitting my test page every 5 minutes.

2012-09-15 18:50:22 W3SVC74 ABC123 x.x.x.x GET /testme.htm - 80
2012-09-15 18:55:22 W3SVC74 ABC123 x.x.x.x GET /testme.htm - 80
2012-09-15 19:00:22 W3SVC74 ABC123 x.x.x.x GET /testme.htm - 80
2012-09-15 19:05:22 W3SVC74 ABC123 x.x.x.x GET /testme.htm - 80

This simple technique can be leveraged in so many powerful ways. Thanks for reading!

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS