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.

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)


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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

679 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