Friday, December 18, 2009

How to change the timeout on Service Communications

When a service starts, the service communicates to the Service Control Manager how long the service must have to start (the time-out period for the service). If the Service Control Manager does not receive a "service started" notice from the service within this time-out period, the Service Control Manager terminates the process that hosts the service. This time-out period is typically less than 30 seconds. If you do not adjust this timeout period, the Service Control Manager ends the process. To adjust this timeout period, follow these steps:

1) In Registry Editor, locate, and then right-click the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control

2) In Control, (in the right pane of Registry Editor) right click and choose New, then DWORD. Notice that New Value #1 (the name of a new registry entry) is selected for editing.

3) Type ServicesPipeTimeout to replace New Value #1, and then press ENTER.

4) Right-click the ServicesPipeTimeout registry entry that you created in step 3, and then click Modify. The "Edit DWORD Value" dialog box appears.

5) In the Value data text box, type 180000, and then click OK. Save this value as a Decimal number and NOT a Hexadecimal number.

Note: TimeoutPeriod is a placeholder for the value of the time-out period (in milliseconds) that you want to set for the service. For example, if you want to set the time-out period to 24 hours (86400000 milliseconds), type 86400000. We set ours to 180000, or 3 minutes. I've had to set it as high as 300000 5 minutes.

5. Restart the computer. You must restart the computer for Service Control Manager to apply this change.