Skip to main content
January 13, 2011
Question

creating PDF's using <cfdocument> hangs the server

  • January 13, 2011
  • 4 replies
  • 4306 views

We are running two ColdFusion 9 servers on Suse linux 11.3, 64 bit.  We are current on all our hot fixes.

Over time (a couple of days usually) all of our PDF reports hang.  No exceptions are thrown.  Eventually they timeout.  A server reboot is required to fix the problem.  The rest of the app functions fine.

Once this condition occures, all of the PDF reports hang (some reports have a lot of data....some have minimal).  If the <cfdocument> tag is empty, the report will execute normally, but even just "hello world" in the cfdocument tag hangs.  I am guessing that there is some system resource that it is waiting for--a thread, memory, etc.  But the rest of the app runs fine, so it appears to be something specific to <cfdocument>.  We are currently configured with 3G jvm, 360 jvm threads.

These same reports have been running for a couple of years on cf8 and cf9 (with no hotfixes).  We deployed a new app on cf9 (with hotfixes) about a month ago which is when the problem started.

We are not sure what else to try....server reboots are getting old.  Any comments would be appreciated.

    This topic has been closed for replies.

    4 replies

    January 20, 2011

    It has now happened on the second server.  Same thing....threads are TIMED_WAITING.

    Here is what the snapshot shows for requests:

    *Total Running requests - 9
    *Total Queued requests - 0
    Template Running requests - 2
    Template Queued requests - 0
    Flash Remoting Running requests - 7
    Flash Remoting Queued requests - 0
    CFC method Running requests - 0
    CFC method Queued requests - 0
    Web Service Running requests - 0
    Web Service Queued requests - 0

    Shouldn't the TIMED_WAITING threads show as queued?

    Participant
    January 21, 2011

    How many PDF pages are you creating? A large amount of pdf pages (greater than 500 or so) also caused our server to hang. The resolution in our case was to use the merge pdf function and we haven't had an issue since.

    January 21, 2011

    We seem to average 300+ pdfs per day per server.  We will look into the merge functionality.  Thank you.

    Participating Frequently
    January 14, 2011

    9/10 times when I've seen cfdocument failing, it's been a DNS issue.

    If the server can't resolve it's own server name, or localhost, it's a big issue for cfdocument as it does make a network call back to itself to perform the operation of converting HTML -> PDF.

    The first place I would check, is that when cfdocument fails, see if you can ping all the various server names that the server is registered under from within the box it is in, including localhost.  You may find it's a weird DNS issue, that is being resolved by a server reboot.

    Let us know how it goes.

    January 20, 2011

    We did have the PDF's hanging again this morning and I was able to call the box (from itself) over http using "wget" and all of the names resolved, so I don't think it's related to DNS.

    Aaron_West
    Participant
    January 14, 2011

    The best thing you can do in this situation is to examine the server during the failure condition. You do this by generating a stack trace. There are several ways to generate a stack trace from running commands on your Linux server to using features of the ColdFusion Admin API. Here are some links to get your started.

    Generating a snapshot/stack trace via code using the CF Admin API.

    http://awe.st/fX6HEy

    PDF of presentation notes and stack trace options from Charlie Arehart.

    http://awe.st/eVvgpw

    Once you've generated the stack trace you need to look through it for issues with memory (JVM heap), CPU, locked threads etc. Reading stack traces is not the easiest thing to do, especially making decisions on what to do based on what you see. In other words, it'd be hard to cover everything in a forum post. But, this sort of analysis should help you figure out more about what is happening during the failure condition.

    January 17, 2011

    Thank you for the helpful info.  We will grab a snapshot as soon as we see the problem again.

    Known Participant
    January 14, 2011

    Is your server, Standard or Enterprise? I am wondering if it is a threading issue.

    January 14, 2011

    We are running Enterprise.

    My original thought was that it's waiting on a thread (it queues up and then times out because no threads are available), but if we were short on threads, wouldn't the rest of the app have problems?