ColdFusion/Railo on Tomcat: Request Timeouts

Posted on July 19, 2011 at 6:49 PM in ColdFusion, Railo

This is totally basic stuff for those who are use to a Tomcat setup, but for those who are new (or relatively new, like myself) to Tomcat, it's critical information. Hopefully by posting it I will do two things:

  1. Help someone else
  2. Remember it myself

Head injuries can lead to memory issues. Trust me, I know this first hand. And there are lots of symptoms of memory issues. One such symptom would be a ColdFusion or Railo process that takes a lot longer than it should.

Today I was working with a process that I anticipated taking ~90 seconds to complete. Lots of objects and database activity involved. However, even with a <cfsetting requesttimeout="1200" /> in place - yes, 20 minutes - the process was still timing out. I could not for the life of me figure out why.

Huge props to Jamie Krug for pointing me in the right direction. You see, Tomcat installs with a pretty low default configuration for memory. In my case, it was set at 128M. Ouch.

First stop Tomcat. Now open up /path/to/tomcat/bin/setenv.sh and look for the -Xmx and/or -Xms settings. I had only one (-Xmx, as I recall), so I added the other, and set both to 1024M.

  1. -Xms1024M -Xmx1024M

Save the setenv.sh file, Start up Tomcat again.

After doing this I re-ran the process that was timing out at 20 minutes, and it completed successfully in...................... 72 seconds.

Now if only I can figure out a way to fix my memory. :D

HTH

UPDATE [7-18-2011]

I should have noted that this was a standard apt-get install of Tomcat 6 on a development machine that had not yet seen any tweaks.

I should also note that I am by no means any sort of authority on JVM tuning. For that kind of authoritative information I would steer you toward Mike Brunt or Railo Consulting. :D

Comments
(Comment Moderation is enabled. Your comment will not appear until approved.)
CodeBassRadio

Latest Articles

Eventually something really brilliant and witty will appear right here.

Calendar

October 2024
S M T W T F S
« Sep  
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Subscribe

Enter a valid email address.

The Obligatory Wish List