Goodbye JRun, Hello Tomcat

Last night I finally kicked JRun to the curb and replaced it with Tomcat on my personal server.  I knew JRun was a pig and that I'd get some improvements by switching, I'd just never gotten around to doing it.  I don't know why I waited.  Here are two graphs from my server, see if you can figure out when the switch happened:

Migration was mind-numbingly simple:

  1. download and unzip Tomcat 6.0.24
  2. change server.xml so the HTTP connector listens on 8082
  3. copy everything from the JRun webroot to the Tomcat webroot
  4. update Apache's config to proxy to Tomcat's port number (8082) instead of JRun's (8300)
  5. start Tomcat, stop JRun, restart Apache

Since I'm running CF8, nothing else is required.  If I were running CF9, I'd need JTA (from http://java.sun.com/javaee/technologies/jta/index.jsp) so Hibernate would work, since Tomcat doesn't bundle it (it's a web container, not an app server).

If you looked carefully at the graphs you'll have noticed two "Tomcat" series, rather than one.  I neglected to increase the MaxPermSize when I first set it up, so the "swap" at about 8:45am was making that change.  The "LCYSA" process is another Tomcat running a pair of Magnolia instances (in different contexts), "Apache" is Apache HTTPD, and "MySQL" is the MySQL 5.0 server I store everything in for all apps.

The charts are generated by a simple CF app that parses `ps v -A O-v` output into a database, and then builds Google Charts from the data. You can view the app, or check out the source. It's not elegant, refined, maintainable, or really even very functional, and I had no intention of sharing until magnus asked in the comments. But I also prefer transparency, so there it is.  A crontab runs `capture_mem_state.sh` every 10 minutes, and then the CFML reads in the files it generates.

20 responses to “Goodbye JRun, Hello Tomcat”

  1. magnus

    What's the CF app? Is is available to share?

  2. John Allen

    Neat. The charting is a good idea and really cool.

  3. magnus

    We recently had a problem with running out of memory on our hosted VPS. Because it was a shared server the ISP restricted virtual memory. When RAM was used up we hit a wall. So being able to easily see what is going on is quite useful. Thanks.

    Ps. any chance of a dump of the database schema. Sorry to ask so much.

  4. Sebastiaan

    Hi barney, would the swap be as easy when running multi-instances of CF8 on Jrun4 on IIS7 in Windows 2003 with MSSQL2005? 'Cause then it would be a viable option for us to get the mem-consumption etc down on ou servers.

  5. Ed

    hi barney, is your server running in J2EE mode?

  6. Brian

    Barney – what about performance beyond memory consumption? How does your app run? My understanding is that one of Railo's big speedups is that it's simply not on JRun. Are you getting a lot of the same boost by just switching out the container?

  7. Sebastiaan

    Hi Barney,

    I'll have to agree on Railo there – develoing all new apps in Railo, but always building them so they are immune to app-engine specific oddities. It means writing as standard CFML as possible, and if needed build in switches for the different app-engines (f.ex. CF8+: CFIMAGE vs. Railo 3+: imageCFC).

    Most of my development work I do on the standalone install with Railo + Jetty on WinXP/Apache/MySQL. Serverwise we're divided between CF8+/MySQL/Windows2003/IIS6 and Railo3+/Tomcat/Apache/Linux – but the Railo engine is so much faster and easier to set up. The two different administrators are a thing of beauty. It takes some time to get used to some Railo quirks in the administrator, and not all you can do in CF-Admin you can as easily or at all do in Railo-Admin. But I believe it's getting there towards v9 compatibility (the next Railo dognamed-version).

  8. Bart

    Hi all.

    In our company we have been running an application on IIS5.0 and JRUN 4.0 for about 6 years already. The app database is SQL 2005. Now we are in the need of upgrading to IIS 6.0 or IIS 7.0. We have been chasing a solution to implement JRUN 4.0 with those versions of IIS and it has been a complete nightmare for months.

    We would like to find an easy way to get rid of JRUN 4.0 and upgrade our IIS server. Do you happen to know if IIS 6.0 or IIS 7.0 works fine with TomCat? Is there an easy way to do the migration smoothly without having to change code? We understand our code is not dependant on JRUN.

    Thank you.

  9. Sebastiaan

    @Bart,

    We've run JRun4 on IIS6 on top of Windows2003 with CF8 now for more than a year with absolutely no hiccups. JRun even is multiinstance, and we have a MSSQL 2005 db-engine. All the sites and the webapps are high-volume, so I don't know what's been bothering you!

    Maybe went your problems here?

    Sebastiaan

  10. Brian

    Barney – thanks for the feedback! Switching to Railo is something we're evaluating but we do use quite a few of the Adobe features like cfchart, cfdocument, etc. I know there are alternatives but we need to figure out the amount of time to switch. We're a Model-Glue/Transfer/Coldspring app… Sean commented there may be some things Transfer does that rely on Adobe-specific behavior so we're looking. May test Tomcat on CF8/9 to see what kind of an instant bump we could get with no code change (just $$$).

  11. sundar

    Barney,
    I want to migrate my batch jobs (java) to Tomcat from JRun. Any idea this can be done without or minimal code change?

  12. jack

    before the switch – did you ever try to tweak jvm on JRun? Jrun out of the box is a pig, but once tweaked it works just fine – and you loose clustering with tomcat….

  13. Ben Nguyen

    Hi Barney,
    Would ya please do me a favor by creating a ODBC Socket Data Source to see if it works? I have installed CF9 on Tomcat 7 build 22. Everythjing seems ok , exception when I tried to add a Datasource name for ODBC Socket, it complained that ODBC is not installed.

    I did reinstalled CF9 many times and whenever I tried to create an ODBC DSN with ODBC Socket , I will get an error of 'ODBC is not installed.

    When Installing/updating CF9, I have selected all subcomponnents to make sure it installed ODBC Socket.

    Please help to see iif it works on your.

    Thanks, BN.