In tomcat 6 i have a servlet running openbluedragon, everything compiles and servers up quik, with the exception of images, they really lag significantly. Any suggestions optimization for image serving?
Here is my server.xml:
<Service name='Catalina'> <Connector port='8009' protocol='AJP/1.3' /> <Connector port='8080' maxThreads='100' protocol='HTTP/1.1' connectionTimeout='20000' /> <Engine name='Standalone' defaultHost='hostname.whatever' jvmRoute='ajp13'> <Realm className='org.apache.catalina.realm.UserDatabaseRealm' resourceName='UserDatabase'/> <Host name='hostname.whatever' appBase='webapps' unpackWARs='true' autoDeploy='true' xmlValidation='false' xmlNamespaceAware='false'> ...context </Host> </Engine> </Service>
Another option is to use apache as a frontend, connecting tomcat with mod_jk. This way you can let apache serve static content (e.g. images, css, javascript) and let tomcat generate the dynamic content. Might leave a bit of work to separate the static content from the dynamic ones, but works great for me.
On Unix, having an apache as frontend is a nice option because being bound to port 80 you’re often forced to run as root. Apache knows how to drop root permissions after binding a port, Tomcat doesn’t. You don’t want a server faced to the public to run as root.
(This is similar to the reverse proxy answer, but doesn’t involve a proxy but mod_jk)