I have a tomcat v6 which contains 2 web applications (JSF2.0 and JSP). The physical server is RedHat Enterprise with 16GB memory.
In current form, the tomcat is exposed to the internet via apache 2.2 and we're by using mod_jk v1.28 connector. so in essence when a user types in
webApp has been configured in
httpd.conf as worker1 which in turn points to above mentioned tomcat v6 above listening on port 8009 to handle the request.
server.xml has the following relevant bits:
<Connector port="8080" protocol="HTTP/1.1" maxThreads="150" connectionTimeout="20000" redirectPort="8443" /> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
worker1 has been configured as:
worker.worker1.type = ajp13 worker.worker1.host =localhost worker.worker1.port = 8009
and in httpd.conf :
JkMount /myWebApp/* worker1
In testing the page load speeds, when i access the web application by accessing the above tomcat directly using its localhost address (localhost:8080/myWebApp), the web application is fast and page load averages about 2-3 seconds max.
Now if i access the same web application, on same network except this time by going via apache (www1.example.com/myWebApp) the page is visibly slower and page load speed average between 10-12 seconds.
is this normal? I am suspecting that the leg work that happens between
apache ---> mod_jk --> tomcat v6 to handle any given request is adding up to the slow speeds? Can someone suggest ways in which i can improve the responsiveness of the web applications when requesting are coming from apache?
DNS lookup delays is out of question given www1.example.com which is mapped to our local IP address so there is definitely no DNS look up delays contributing to this delay.