Hi,
In our Solaris(SunOS5.6) system, I installed the Apache 1.3.27, mod_jk_1.3_no_eapi.so, and 2 copies
of Tomcat 4.1.8. The apache will act as frontend
and dispatch requests to the 2 instances of Tomcat.
There is no error shown when I configure,install
and run the servers.
I also use the Grinder as stress test tool:http://grinder.sourceforge.net/
To test the system, I changed the Tomcat1, Tomcat2 http listening port to 9990,9991,
the Apache is listening at 2947, the mod_jk
ports are 11009, and 12009.
From the server.xml, it seems the Tomcat can serve at most 75 concurrent requests. From httd.conf, the Apache can serve 175 requests.
I placed a very simple JSP file in the web application root, and wrote a grinder test script
which sends 70 requests in very short time.
Here is the testing results:
1, if I use the grinder to send requests directly
to Tomcat, the mean response time is about 600ms
2, if I use the grinder to send requests to Apache, the mean response time becomes pretty big,
like 4s. this result is really weired.
I then checked the Tomcat log, it seems all 70 requests were dispatched to Tomcat1, which I guess
is normal since the limit of Tomcat1 is 75.
But in the Apache/logs/mod_jk.log, there were some
error messages like
Fri Jan 10 08:45:01 2003] loadbalancer
my.com my.com 2947 200 0.167065
[Fri Jan 10 08:45:01 2003] loadbalancer my.com my.com 2947 200 0.116934
[Fri Jan 10 08:45:01 2003] loadbalancer my.com my.com 2947 200 0.146300
[Fri Jan 10 08:45:01 2003] [jk_ajp_common.c (681)]: ERROR: can't receive the response message from tomcat, network problems or tomcat is down.
[Fri Jan 10 08:45:01 2003] [jk_ajp_common.c (1050)]: Error reading reply from tomcat. Tomcat is down or network problems.
[Fri Jan 10 08:45:01 2003] [jk_ajp_common.c (1187)]: ERROR: Receiving from tomcat failed, recoverable operation. err=0
[Fri Jan 10 08:45:01 2003] [jk_ajp_common.c (681)]: ERROR: can't receive the response message from tomcat, network problems or tomcat is down.
[Fri Jan 10 08:45:01 2003] [jk_ajp_common.c (1050)]: Error reading reply from tomcat. Tomcat is down or network problems.
[Fri Jan 10 08:45:01 2003] [jk_ajp_common.c (1187)]: ERROR: Receiving from tomcat failed, recoverable operation. err=0
[Fri Jan 10 08:45:01 2003] loadbalancer my.com my.com 2947 200 0.117587
[Fri Jan 10 08:45:01 2003] loadbalancer my.com my.com 2947 200 0.125157
[Fri Jan 10 08:45:01 2003] loadbalancer my.com my.com 2947 200 0.122595
This errors shows that the communication between Apache(mod_jk) and Tomcat got trouble randomly.
I also made another tests which sent 100 requests to Apache, and from the tomcat log, it seems this
time the Tomcat2 got some hits.
From my testing, I feel the mod_jk did work, as load balancer, to dispatch requests to multi tomcat instances.But the whole performance is bad
because of the error shown in mod_jk.log.
I will post the httpd.conf, server.xml, workers.properties files in following posts.
Any advice is greatly appreciated!