Sunday, March 15, 2009

Tomcat Connectors

Typically Communication protocol between apache and tomcat is AJP

Apache used mod_jk to speak AJP(Apache Jserv Protocol) to tomcat .

AJP is a binary packet based protocol - hence difficult to debug and limitation on packet size

  • AJP on tomcat side

Java Connector(BIO) - Blocking IO , one thread per connection

APR Connector - Allows more connections , allows polling

Java NIO Connector

  • Tomcats Http Connectors - can replace AJP specific features ,more options , more control ,Finely tuned,easy to debug since its text based

Nio , APR Connectors, BIO - fastest when not using persistent connections

  • mod_proxy_http - for HTTP - native protocol level support for authentication and SSL

  • HTTP Connector -

o.a.coyote.http11.Http11Protocol (BIO)

o.a.coyote.http11.Http11AprProtocol (APR)

o.a.coyote.http11.Http11NioProtocol (NIO)

HTTP/1.1 aliased to Http11 and Http11Apr depending on PATH or LD_LIBRARY_PATH settings

  • AJP Connector -



AJP/1.3 aliased to the two above
Depending on PATH or LD_LIBRARY_PATH settings

  • Use BIO if

Stability is the highest priority APR and NIO are more recent
Most content is dynamic
Keep alive is not a determining factor


  • Use APR if

SSL is terminated at Tomcat
Platforms are Linux or Windows
Keep alive is important
Lots of static content
Using Comet feature


  • Use NIO if

Compiling APR is not an option
SSL is terminated at Tomcat
Keep alive is important
Lots of static content
Using Comet features


  • requirement connectors in preference order

Stability --> Bio, APR/NIO


Low Concurrency --> BIO,APR,NIO

High Concurreny with keepAlive --> BIO,APR,NIO

Hig Concurrency with no keep alive -->APR,NIO,BIO

  • The native APR connector is unstable on Solaris

No comments:

Free Domain Names @!