.net session timeout in IIS6

March 26, 2009 | Leave a Comment

Does this sound simple web.config setup?
Nope this is way beyond that newbie configuration.

Problem: We were facing timeout issue on one of our servers. Web.config settings had no effect on the time out.

Note: In all screen shots pink color is hiding the actual server details.

Solution:
So here are some more interesting findings related to timeouts of sessions in IIS6 hosted on a windows 2003 server. You may need to change one or more of these setups in your server according to your setup.
There are totally 5 setups that influence your timeout. All of those are discussed here.
1. Web.config file of Application: First one to influence timeout is Session timeout setting in your we.config file.













Note: Web.config file is inherited to the subfolders and subfolders config settings take the precedence in case they exist.

2. Application session timeout in IIS:
Go to IIS, right click on the web application, go to properties. Go to Directory tab, click on Configuration button. Application configuration tab opens, click on Options tab as in the screenshot, you will find enable session state. Change the session time out period here.














3. Default website session timeout in IIS: Right click default web site under IIS and choose Home directory tab. Click on configuration button to open application configuration. Choose options tab and you will find Enable session state again similar to session state of each application. Enter higher session timeout period which will be application to all sites in the webserver.














4. Change Worker process idle timeout of application pool – Shutdown worker process after being idle for (time in minutes) – Default is 20 minutes. This setup is applied for all websites that use this application pool. To change this, Right click on the required application pool, choose Performance tab, and change the duration of idle time or uncheck the option so that the process is never recycled. You can also create an application pool, configure it, and use it for a selected list of web applications.














5. Change Recycle timeout period of application pool: Right click on application pool or default application, and choose Recycling tab. Change the “Recycle worker process (in minutes)” option to either change the period or disable the option by un checking. Un checking this option may be a good idea from performance point of view.

And finally there is a last one in machine.config file. But that does not affect any of these configurations and these setups take the precedence.

Fix Internet Explorer 7 Crashes in Vista

November 12, 2008 | Leave a Comment

A lot of you may have seen Internet Explorer crash “Internet Explorer has stopped working” when closing the browser in Windows Vista. It happens all too often and while it no longer takes the operating system out with it, it is still annoying.

There are a lot of reasons why Internet Explorer will do this, but one we have found that really stands out is Adobe’s Flash Player plug-in and ActiveX [COM Client] control. Seven (7) of ten (10) IE 7 crashes I have personally seen, are related to the Flash Player plug-in.

A lot of users may see messages advising them to re-install the Flash player and many take this advice - but they don’t see any relief and the plug-in continues to un-plug IE.

Fortunately, Adobe has published a less well known Flash Player removal tool and procedure that users should use and follow BEFORE they re-install the plug-in.

Please reference Adobe’s Support Site, which states: (be sure to follow all instructions and take note of the files Adobe’s uninstaller cannot remove)

“How to uninstall the Adobe Flash Player plug-in and ActiveX control”

Due to recent enhancements to the Adobe Flash Player installers, you can now remove the player only by using the Adobe Flash Player uninstaller. To remove Flash Player, simply download and run the appropriate uninstaller for your system using the steps below.

  1. Download the Adobe Flash Player uninstaller:
  2. Save the file to your system, choosing a location where you can find it (for example, your desktop). Macintosh users may need to open or unstuff the .hqx file.
  3. Quit ALL running applications, including all Internet Explorer or other browser windows, AOL Instant Messenger, Yahoo Messenger, MSN Messenger, or other Messengers. Check the Windows system tray carefully to make certain no applications which might possibly use Flash Player are still in memory.
  4. Run the uninstaller. This will remove Adobe Flash Player from all browsers on the system.

Note: The uninstaller cannot remove files currently in use.

If you have any instances of the player open in your web browsers, instant messaging clients, stand-alone SWFs, or projectors, then the uninstaller will complete but some files may not be deleted. If this occurs, then close all of your applications and run the uninstaller again to ensure that all files are removed.

 

Note: Internet Explorer users may have to reboot to clear all uninstalled Flash Player ActiveX control files. If you’re not certain, select the “Show Details” button in the Flash Player uninstaller. If there are any log lines that begin with “Delete on Reboot…” then you’ll need to reboot BEFORE running the Flash Player installer again.

After running Adobe’s tool and following their procedure for removing left over files, we restart the computer and reinstall the Adobe Flash Player plug-in and IE 7 on Vista runs much more reliably. Of course many other plug-ins can cause IE to crash, but since Flash is so common on so many websites, it is much more likely to be encountered.

 

 

Network port configurations for MSDTC

July 27, 2008 | Leave a Comment

What is MSDTC?

MSDTC is the Microsoft Distributed Transaction Coordinator, which is a transaction manager program that permits client applications to include several different sources of data into one transaction. MSDTC then coordinates committing the transaction across all of the servers that are listed in the transaction. MSDTC runs on all Windows operating systems, and is also installed by a variety of Microsoft applications, including Personal Web Server and SQL Server.

What Network Ports are Used?

MSDTC uses a number of TCP network ports for sending and receiving messages. This fact must be considered when MSDTC is running in a network environment where the servers involved in the transactions. Say you are running a multi-tier application, and each tier is separated by a router or firewall for security purposes. An example would be an application server in one tier communicating with a SQL Server database You will need to know what port numbers need to be opened for MSDTC transaction information to be able to pass through successfully.

For sending out transaction messages, MSDTC always uses the same TCP port - 135. Dealing with the response message is a little more tricky. MSDTC response messages return on a dynamically assigned port anywhere in a range from 1024 - 5000.

Configuring the MSDTC Respone Port Range

As most of you can probably guess, network administrators are not very fond of opening a wide range of ports all at once. So in order for MSDTC communications to still work and keep the network administrator happy at the same time, you will need to reduce the port range used by the response messages. This change is configured in the registry of the servers involved in the MSDTC communications. You will need to add a couple of keys to the registry.

Note: Please make sure to always take a backup of the registry prior to making any changes!

The location of the change is:

HKEY_LOCAL_MACHINE\Software\Microsoft\Rpc\Internet

The following entries need to be added:

Ports : REG_MULTI-SZ : 1024-1054

PortsInternetAvailable : REG_SZ : Y

UseInternetPorts : REG_SZ : Y

(There is a space both before and after each colon)

In this particular example we are limiting the responses to a port range of only 1024-1054. The exact range of ports to use is basically up to each individual organization.

Testing MSDTC Communications

So how do you know your changes were successful? Microsoft provides a handy little tool called DTCPing.exe that you can use to test MSDTC communications between servers. DTCPing can be downloaded from:

http://www.microsoft.com/downloads/details.aspx?FamilyID=5e325025-4dcd-4658-a549-1d549ac17644&displaylang=en

This file is a self-extracting zip file.  Confusingly, the zip file and actual executable file are both named “DTCPing.exe”, so you need to make sure to extract to a separate directory, otherwise you will receive a ‘Cannot create output file’ error message.

Once extracted, simply launch DTCPing.exe. The tool must be up and running on both the sending and receving servers, otherwise the test will fail. The initial screen of the tool will look like this:

DTC Ping





From here just type in either the NetBIOS name or IP Address of the remote node and click Ping. Test messages will appear in the DTCPing windows of both the sending and responding servers, and a summary of the test will be presented at the end. The test scenario will also be written to a log file that can be found in the same directory as the DTCPing.exe file.

Orphaned DTC Transaction

May 24, 2008 | Leave a Comment

A few days ago, one of our applications was crashing the IIS application pool because of an unhandled exception. After some research we figured out the case of it was an orphaned MS DTC transaction.

When multiple connections are operating over one MS DTC transaction, this problem sometime shows up. As many connections are working none of them try to roll back the MS DTC transaction, this creates an orphaned connection, which crashes IIS application pools.

You can figure out if there is orphaned connection or not in your application using the following script. If there is an orphaned connection it will show up in the result (s), otherwise the script will return no results.

SELECT DISTINCT(req_transactionUOW) FROM sys.syslockinfo WHERE req_spid = -2

We fixed this issue using Hotfix provided by Microsoft.

Next Page »