ColdFusion swsoc.exe service and excess CPU usage

Experienced a significant ColdFusion server issue today worth documenting. Access to ColdFusion based pages was being rejected (a JRUN connection closed error) causing lack of access to a range of service (including a site CMS). Checking the task manager (on a Windows 2003 Server) showed swsoc.exe consuming a large amount of CPU time (upwards of 60%). Ending this process (swsoc.exe) or restarting its associated service (ColdFusion ODBC Server) fixed the issue temporarily however within 3 - 4 minutes the JRUN connections were being reported as closed once again.

A number of other users appeared to have experienced similar problems.

Thus the troubleshooting began including:
- checking for any required database repairs
- upgrade of CFMX drivers
- adjustment of login timeouts on datasources
- switching on debugging
- utilised limiting ColdFusion query times to 60 seconds.

Like any problem resoloution process, it is useful to keep a log off each action for change management impacts. eg


12:33pm Changed datasource1, datasource2, datasource3, login timeouts to 120 seconds.

12:37pm Upgraded drivers to v3.3. Moved macromedia_drivers.jar (v3.1) to server desktop
Sourced: http://www.macromedia.com/support/coldfusion/ts/documents/cfmx61_sqlserver_cpu.htm

The problem was eventually isolated to some code that queried upcoming events. The limiting query option allowed this to be debugged as the CFMX server would stop the query when it exceeded 60 seconds. The relatively simple query would not require in excess of 10 seconds hence this code was isolated as the issue. It appears that in attempting to run the code some non-compliant data was causing the CFLOOP command to move into an infinite loop, causing the swsoc.exe process to consume large amounts of CPU resources and prevent further connections to the JRUN.exe service. Commenting out the queries causing the issue resolved it immediately.

Copyright Time n 1998 - 2008