20070815 Wednesday August 15, 2007

Jetty 6.x versus Tomcat 6.x An AppFuse user asks:

Has anyone done any performance benchmarking between Jetty 6.x and Tomcat 6.x to see which one is better for production use in terms of scalability, performance and ease-of-use? I'm gearing towards Jetty 6.1 but want to hear other's opinions first.

I admit, I completely changed the wording in this quote to make it more readable.

Most of the companies I've worked with in recent years have been using Tomcat (very successfully) in production. However, I also know the Contegix and JavaLobby guys continue to swear by Resin for the most part. What's your opinion?

IMHO, I don't think it really matters - they're all good enough for production use. Posted in Java at Aug 15 2007, 09:50:17 AM MDT 6 Comments

Comments:

My current project uses both. We use Jetty for basic, local testing and we're about to start using it for continuous integration testing with Selenium. We like it because it's so self-contained. I want as much control over my test environment as possible and using Jetty with Maven gives us that kind of control (not to imply we couldn't do pretty much the same thing with maven + tomcat + cargo too - but we don't). For staging however, we use Tomcat. I think the choice to go with Tomcat for the higher tiers is mostly just out of habit and the perceived pervasiveness of Tomcat (versus Jetty or Resin). Our app is so self-contained already, in that it doesn't rely on app-server services from bigger, fuller-featured servers like JBoss AS, that in the end, it likely doesn't matter what we run on.

Posted by Terry C. Martin on August 15, 2007 at 11:55 AM MDT #

Resin (w/ JRockIt JVM)

Posted by Vic on August 16, 2007 at 07:15 AM MDT #

Development - Tomcat standalone Production - Apache Web Server and Tomcat with AJP connector.

Posted by SM on August 16, 2007 at 09:17 AM MDT #

I don't know that you can embed Tomcat as well as you can embed Jetty. Once you get into testing with an embedded webserver it is very nice. Plus with webdriver giving you an embedded browser, web testing is looking a lot sweeter for me.

Posted by Joe Walker on August 16, 2007 at 04:16 PM MDT #

@joe:

Terrible simple to embed Tomcat:

File CATALINAHOME = new File("./var/catalina");
File WEBAPPS = new File(CATALINAHOME,"webapps");
File ROOT = new File(WEBAPPS, "ROOT");

Embedded server = new Embedded();
server.setCatalinaHome(CATALINAHOME.getAbsolutePath());

Engine engine = server.createEngine();
engine.setDefaultHost("localhost");

Host host = server.createHost("localhost", WEBAPPS.getAbsolutePath());
engine.addChild(host);

Context context = server.createContext("", ROOT.getAbsolutePath());
 context.setParentClassLoader(Thread.currentThread().getContextClassLoader());
host.addChild(context);

server.addEngine(engine);

//Http
Connector http = server.createConnector("localhost", 8282, false);
server.addConnector(http);
//Start the server 
server.start();

Pretty easy ;-)

Posted by 209.181.65.238 on August 17, 2007 at 10:17 PM MDT #

Hi, and how do you register servlets (not whole war files) to the context? Thanks!

Posted by RPR on April 10, 2008 at 04:50 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is the Lead UI Architect at LinkedIn. The opinions on this site are mine, not my employers.
« September 2008
SunMonTueWedThuFriSat
 
1
2
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
    
       
Today

Recent Entries

Tag Cloud