The JRun Closed Connection error can cause a lot of frustration but if you understand how to debug and find the issue that is causing it, then you can resolve the problem quickly. The JRun Closed Connection error is caused by an issue that occurs in the JVM that causes the JVM to close the socket that is open from the external webserver connector (IIS, Apache, Iplanet) to JRun. The JVM problem can occur due to several different issues
- outOfMemory or the JVM approaches the max heap
- Native code in a CFX or COM objects causes an error in the JVM
The memory condition can occur in several different cases
- If debugging is left on in production with CF (make sure you have it turned off in production not just masking the IP's)
- Large resultsets are returned from the database taking up a significant amount of memory (reduce the size of database results you are returning)
Diagnosing the issue: In order to diagnose this issue there are several areas to start. By turning on metrics and JVM Verbose GC output you can monitor the memory and find out if memory utilization is the problem. In some cases the memory spikes very quickly and comes back down. A large recordset returned from a query can cause this behavior. The recordset will populate into memory and GC will clean it up quickly. If the size of the recordset pushes the heap beyond the max heap you will see a problem. Although you may not see an outOfMemory error everytime. Any connections that were in use during this spike will get a JRun connection closed error. If you look in the webserver connector logs you may find connection reset by peer errors as well.
Also review all of your logs for long running pages and errors in the Application.log. If you have a number of errors correct each issue also identify and fix any long running pages.
For example with IIS you need to uncomment the #errorurl parameter and set it to the html page
While I have not covered every possible issue that can cause JRun Connection Closed errors I have at least provided some quick debugging steps. I will continue to update this entry as I find more approaches for debugging this problem.
We are experiencing this problem! We have a COM object that I think may be causing the crash. It worked fine in CF5.0. How can you determine if its the COM or other long running templates?
I would load test the app and use the steps in this posting to monitor http://www.bpurcell.org/blog/index.cfm?mode=entry&ENTRY=967
We are having a closed socket error that doesn't seem to be alike any error pattern I have found at the blogs and forums...
debug DMGC collected 0 caches, 0 remaining. debug DMGC collected 0 destinations, 1 remaining. debug DMGC collected 0 caches, 0 remaining. debug MM GC collected 0 messages, 0 remaining. debug DMGC collected 0 destinations, 1 remaining. debug webserver closed it's socket debug webserver closed it's socket debug webserver closed it's socket debug webserver closed it's socket debug webserver closed it's socket debug webserver closed it's socket debug webserver closed it's socket debug webserver closed it's socket
And after this "webserver closed it's socket" starts usualy the website goes realy slow and we have to reestart the whole thing (IIS, Jrun). Sometimes I have the feeling that the problem it at IIs, but I feel that it could be application related, metrics.log shows no significant increase of RAM use. What in heaven might that be, any clues?
I have an issue where 4 load balanced CF6.1 servers all throw "Jrun Connection Closed" errors (and corrosponding 503's in the IIS logs) at exactly the same time. I'm convinced that this has something to do with the MSSQL server, but no matter where I look I don't see anything in the logs that even remotely points the way at this. The CF logs contain no entries anywhere near the time this happens, SQL continues to work just fine (no exceptions there either). I'm a bit stumped as to how to debug this, there seems to be no rhyme or reason as to when it happens although I do know that it is load related (only happens on heavy days for us).