Random "socket write error" in ColdFusion

Posted on 2013-10-29
Last Modified: 2013-12-02
We have a production web application running on multiple servers using IIS 6 (Windows 2003 standard edition). We have web pages using coldFusion version 9.01 Standard Edition , and we started to see random errors in the coldfusion-event-xxx.log pages. the error is something like this:

10/28 13:32:26 error Error while reading header HTTPREFERER Software caused connection abort: socket write error
      at Method)

NOTE: the header can be anything, but the stack always starts like this.

most times you see a handful of such errors per day, and there is no side effect, but occasionally a server will show a stream of such errors, and it will become largely unresponsive, with queued requests.

a reset of ColdFusion service along with IISRESET fixes the server.

any insight how to go about fixing it?

the CFM pages are making a lot to CFHTTP calls, usually to pages on the local server written in .NET. not sure if this the underlying reason for this problem, but we have increased the number of such calls dramatically i the last year as more and more pages are written in .NET and are accessed from the legacy CFM pages.
Question by:structuredweb
  • 4
  • 2
LVL 27

Expert Comment

ID: 39610618
I don't know what's causing the specific issue here between IIS and ColdFusion, but that socket write error in Java almost always occurs because the socket has already been closed by the time you go to write to it.

So I'd look at possible causes for the socket to be terminated quickly.  That could be due to network issues or it can be other problems like hitting a limit on the maximum number of open sockets (so you go to create a new socket, it fails and then you get this write error when the code tries to use the socket).

Sorry I can't be more help but I hope that at least helps fill in some of the picture.


Author Comment

ID: 39611550

thanks for your reply.

How can I see, and change if needed, the maximum number of open sockets? is there anywhere i would see that this limit has been reached?

I do not think this is a net work issue because:

Its a very good and fast network that is tested regularly.

Other pages, non java or CFM, work fine as this is happening.

The one variable which has changed significantly over the last year is the number of CFHTTP calls we make from the CFM pages.
LVL 27

Expert Comment

ID: 39613115
I know for Linux the max number of open sockets is controlled by the max number of file handles allowed on the system - which in turn is set in:

I don't know how Windows 2003 server handles the limits, but this article suggests some possible approaches to raising the file handle limit:

This is the sort of thing that you can run into when under heavy load - since both the number of open files and the number of open sockets will both tend to climb in that case and perhaps hit a limit.

We've certainly routinely had to raise this on Linux servers.

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.


Author Comment

ID: 39614615
Doug, apparently in Windows Server 2003 there is a limit on the # of open sockets ,and it is 5000

these articles basically saying you can increase the number of allowed open sockets, and also decrease the timeout before sockets are finally closed.

what i'm doing now is i have a schedule which looks for these errors every 10 minutes and run a netstat command as well ,so next time i get this situation hopefully i will have data to show me how many open sockets existed in the system at the time of the errors. I'd rather not touch these registry settings before i know for a fact this is the issue.

Accepted Solution

structuredweb earned 0 total points
ID: 39681583
OK, i managed to fix the problem, not at the TCP level, I still get these phantom errors, but by increasing CF concurrency I eliminated these bottlenecks where requests were stuck in thre queue and CF was not responding. this is what I did

1) go to <CF-install-root>\runtime\lib\wsconfig\1
2) Make a copy of jrun_iis6_wildcard.ini
3) Edit jrun_iis6_wildcard.ini, uncomment "maxworkerthreads" and set it to 50
4) go to the admin interface
5) click on Request Tuning
6) Change "Maximum number of simultaneous Template requests" to 40

Author Closing Comment

ID: 39689447
well, it worked. still don't know why im seeing the random socket errors, but CF is working just fine now

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question