Tomcat/Cocoon Performance on Production Sites?
Saqib Ali asks: "A Tomcat/Cocoon setup can be used as a framework for publishing XML content. I have this setup running in testing environment for about 5 months now, and would like to move it into production. Is anyone using a similar setup and can comment on Tomcat's ability in handling the load from a production environment, or should we look at other Java Servlet engines like BEA, Jetty or Resin? If Open Source solutions can't work under these kind of pressure what should we be looking at in terms of different commercial solutions for publishing XML content?" A similar question with respect to Tomcat and Jetty was discussed in this previous discussion. What effects does using Cocoon have on Tomcat-based environments?
Ive had multiple tomcat servers running on a sunfire E6800 (24 processor, 32GB ram etc..) under solaris using j2ee 1.3 and they have all been working fine, not one single server failure. One of which is a webapp server that has a variety of apps running on it, and the other is essentially an 'xml server' used for a varitey of applications (globus, grid computing etc). Theses are both based on tomcat 4.0, and there are some more running but i forget which version of tomcat they use
I have this setup running in testing environment for about 5 months now, and would like to move it into production.
I can't find the words to ask this without sounding like an ass but, I really don't mean to be.
I have to ask though, what have you been testing for the past 5 months. When testing a server, web, mail, database, whatever, one of the early tests that I perform is load testing. Have you not done load testing to determine if Cocoon will handle your anticipated load and then some?
Why waste 5 months development time on a product that you don't know will support the load? Suppose it doesn't handle it (which I doubt), are you going to chuck 5 months work to move to BEA, WebSphere, IIS????? What have you been testing?
I have taken 2 production environments from Tomcat to Resin.. I have Resin to be more robust and easier to develop w/than Tomcat for various reasons. (First and formost the error message points you strait to the line of JSP rather than the error code linking back to the servlet. Resin does have some performance perks over Tomcat, but unless it's a VERY high volume site w/lots of load balanced servers, it's not going to probably matter much.
The thing I would say #1 is what you know. I know Resin inside and out, and when something goes wrong.. I know how to deal with it. Tomcat, I can't say the same thing. For this reason, it's been well worth the 500 dollars per server to deploy resin, as it's cheeper for us to maintain.
But, I have been working with resin for 3 some years now.
If tomcat works for you, go for it.. if it holds up under the stress tests , etc.. use it!
Good luck either way, but if you do look to a commercial product, definately give Resin a serious look. http://www.caucho.com
Well, that depends on whose production environment. What do you mean by load? 1req/min? 1req/sec? 1000req/sec? What does it take to fulfill a request?
/. is going to be able to answer this question for you. You'll need to load-test your Tomcat configuration yourself and see whether or not it is performant.
No one on
Personally, I prefer resin, but have had successful JBoss/Tomcat configurations. But every situation is different, so you'll have to do some load testing.
Good luck!
"Avoid employing unlucky people - throw half of the pile of CVs in the bin without reading them." -- David Brent
e-business intranet site. :
Server is a E450 with 4 x USii 450Mhz, 8 GB RAM and A3500 RAID-5 using FCAL SCSI 10K RPM drives.
40 megabytes data processed per request.
DB Server is Oracle 8i (Enterprise) with 6 GB RAM allocated to it. Servlet running on tomcat uses DB connection pooling and caching + the oracle JDBC driver. Approx. 40 megabytes of data is exchanged with oracle per request using simple (SELECT/INSERT) type statements with all the logic in the servlet and no SQL processing involved.
Web & Appserver is Tomcat 3.2.4 (the newer versions crashed and couldnt handle the load) with JDK 1.4.1 from Sun running in hotspot server mode with 1 GB of RAM dedicated in the JVM.
Server has 1 GB RAM free for Solaris 8 & TCP autotune settings are enabled. No swap usage even on heavy loads.
Tomcat cookies are enabled and session state maintained using cookies.
Performance
4 requests/second sustained. 5 requests/sec max recorded. 3.45 requests/sec under heavy load (large Q).
I've used both Tomcat and Resin (Tomcat much more back in the 3.x days, but a little 4.x too). I found Resin to be at least somewhat faster (definately the JSP engine was a lot faster), easier to configure, and generally well worth $500/server.
:-). I find Resin + Apache a great combination (Resin handles application stuff, Apache handles static data + security needs).
That said, Tomcat works fine for my needs, but I have not tested it under heavy loads. I *have* stress-tested Resin, and I can say it has never failed me
It's a strange world -- let's keep it that way
one of the simplest tomcat performance improvements i've made is by switching from sun's vm to bea's jrockit. jrockit is free to use, and in my experience a much more robust server side environment. it's faster, has more flexible garbage collection options, and a nice gui management console. it helps to have a lot of memory (i think by default it will use 75% of the available system memory), but for some of the webapps i've built, i've seen tomcat+jrockit turn out 15-20% more pages/sec than tomcat+hotspot. jrockit 8 beta came out recently; it supports jdk-1.4 and has been solid for me (so far) running tomcat, jetty, and jboss. i've even been using jrockit on my personal workstation while developing with jboss because it cuts the startup time from about 1m:45s to 50s.
d ex .shtml
http://www.bea.com/products/weblogic/jrockit/in
other than that, i've found a big tomcat performance problem to be that of spawning new threads. the default connector's configuration sets minProcessors=5 (ie: 5 threads in the threadpool available to handle new requests). i find that when load is high enough to warrant more than the number of initial threads, requests get dropped on the floor while more threads are added to the pool. so don't be shy about starting enough request processors from the beginning.
also, don't be afraid to run some load tests on your app while profiling. you'll need a fast machine to run tomcat+cocoon under a profiler, but the results are often very helpful in finding bottlenecks. in particular, you'll probably find a lot of time spent in StringBuffers, which is normal for an app like yours, but it's a good place to start when you're interested in shaving a few seconds here and there.
hope that helps a little.
You might want to consider Apache's AxKit. While parts of AxKit are written in Perl to make it faster for us to write, the key parts that do the heavy lifting are written in C for performance reasons. Some fortune 500 companies are already running their site on it, and we get an awful lot of people coming to us from Cocoon for performance reasons.
It's a full apache project (under the XML umbrella), just like Cocoon is, and incorporates the same technologies (XSLT and XSP), but a lot of people skip over it because it's not Java. Maybe now is time to re-evaluate that decision.
Matt. Want XML + Apache + Stylesheets? Get AxKit.
The site in question gets about 60-655K hits/day running in a 2x1.13GHz PIII/1GB RAM running Linux ( 2.4 series) with JDK 1.4 using an Apache front-end for SSL. We run Tomcat 4 and Cocoon 2, making judicious use of caching (we serve pre-transformed HTML pages generated from Docbook XML sources), but every page is dynamically generated. Haven't yet seen anything that makes me think we'll need anything beefier in the near future.
"Oh, I hope he doesn't give us halyatchkies," said Heinrich.
That's 60-65K hits/day. that oughta learn me not to preview.
"Oh, I hope he doesn't give us halyatchkies," said Heinrich.
I have been running tomcat on 2 production servers (1 = 4xXeon 700 with 2GB Ram, 2 = 2xAthalon 1.3Ghz 1GB Ram) for about 8 months and they have been pumping out the content with little to know problems (the xeon box came down twice but it turned out to be a bad proc). In addition to the stability I have found them to quite snappy even under a heavy load. The only other pice of advice is that they like their memory at least 1GB and to run lots of daemons by default they seem to take a sec to start. Good Luck!
To see this in action take a look at: Point2 UsedIron
Please excuse the off-topicness, but you've just voiced my biggest gripe against the whole Java fad. I was there when Sun touted Java as the answer to computing's Holy Grail: Write-Once, Run-Everywhere. Except that it ain't necessarily so. Nearly every day, I encounter another Java app that runs in any OS you care to use, as long as it's Windows. GRRR!!!! Whenever I hear a new Java convert espousing its merits, the hypocrisy of the whole thing just about kills me. Every point where Java is supposed to shine is directly contradicted by my personal experience. It's not just a few exceptions that spoil the image. MOST of the JAVA apps I've been forced to deal with are slow, bloated, buggy, and worst of all, NON-PORTABLE!
</RANT>The Web is like Usenet, but
the elephants are untrained.
Most of the responses have concentrated on which of the servlet engines people have used.
I believe you need to focus more on the application - the performance of the best servlet engine can be crippled by a poorly designed application. Cocoon (and XML/XSLT in general) is not the fastest way to render a page.
I'm assuming you've invested enough time and effort into your cocoon development to be reluctant to throw it out. I would therefore suggest rigging your cocoon components to output performance logging information, put together a load testing infrastructure, and see what happens. Work out where your bottlenecks are (usually I find one or two bits of functionality which consume disproportionate amounts of time/resource), and see whether they can be optimised. Caching will yield significant benefits, esp. if you use relatively static information.
Only once you understand the performance characteristics of your application is it time to look at the infrastructure and see whether it addresses your application's requirements. For instance, improving the performance of your JVM is unlikely to yield any benefits if your application spends 80% of it's time doing XSL transformations.
FWIW, I think the Tomcat server is plenty fast enough for mainstream use; it's usually cheaper to add load-balanced hardware than pay for a commercial product.
It's all very well in practice, but it will never work in theory.
I don't want to start a flame war here, but I have ported some VERY large java applications to various OS's, and for the most part.. things went VERY well. I also don't consider myself a 'new convert' to JAVA either. I appreciate your rant as a Windows/Linux user.. but 90% of the coding work I do with java is in the COBOL sense of business middle-ware.
Usually the only thing that really bit-the-bot was someone hard coding paths into the code, rather than using a configuration file or something of the sort or referencing an external JNI call to a native library. This is VERY uncommon in the code that I have worked with.
Maybe with Swing/AWT applications, your right.. but on the server, which it doesn't sound like you have done much programming w/JAVA on, JAVA has lived up to it's promise. It's EXTREMELY portable. Over the last year I have switched my build managment to ANT, and if done correctly, will help even further in keeping things clean across multiple platforms.
As with ANY cross-platform tool
Nice karma whoring tho mate.
No, for flame wars Usenet is a far better medium. (grin!) In all fairness, my gripes are mostly directed at Java in the user interface rather than Java on the server; your claims to its effectiveness are probably very well founded, as far as they go.
All of which is right on-track. No, I don't program in Java, though I'm forced to use it occasionally. From a programmer's perspective, Java may well be the cat's pajamas, but from a user's perspective (mine), Java sucks.
Harrumph! Posted too late in the discussion to win any mod points; if I were karma whoring I would have at least included some links. Moderators always like to see some links, even if they don't bother to follow them.
The Web is like Usenet, but
the elephants are untrained.
All of which is right on-track. No, I don't program in Java, though I'm forced to use it occasionally. From a programmer's perspective, Java may well be the cat's pajamas, but from a user's perspective (mine), Java sucks.
Agreed. I haven't really found a java-based application that I love to use (from the user-interface standpoint)
Really, I see JAVA as nothing more than a todays COBOL. It's GREAT for business based software, and really is quite easy to maintain and manage. But, middleware doesn't really have much to do with UserInterface. (There is probably hundreds of millions of lines of JAVA code sitting in the back-end of windows-based native applications, that you would never guess...)
Anyway, cheers!