Apache + Tomcat = slow performance for static pages?

Hi, my admin has config Apache to work with Tomcat, she said using Apache + Tomcat together, the jsp/servlets will load faster, but the static pages will "hesitate" for a fraction of a second and then the pages got load up. Also, the size of the log file for mod_jk has increased to 3MB by just using Apache + Tomcat for about 20 minutes.

So does anyone experience something like that? The size of log file for mod_jk is really that large? Or does anyone know how to optimize the performance for both static pages and servlet when using Apache + Tomcat? Thanks in advance.

[593 byte] By [GMU] at [2007-9-26 1:59:21]
# 1

hi,

the most optimal solution theoritically is to let Apache serve the static HTML pages and let Tomcat do the work on the JSPs. this combination gives a good solution. please check with ur admin whether ur Apache and Tomcat have *really* been configured properly...

keep programming...

-satyen

filtertipped at 2007-6-29 3:18:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Once established you can drop the mod_jk log level to something lower than what you had (from your description sounds like it was set to "debug") and you only need to change it if it stops working. In a way it is obvious that the log would grow in size as mod_jk is the connecter between apache and tomcat and so it would only be in use when they are combined.

Breakfast at 2007-6-29 3:18:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Thanks very much, Breakfast. I just checked with the mod_jk.conf and mod_jk.conf file, the jkLogLevel is "warn", and in the mod_jk.conf-auto file, the jkLogLevel is "error". Both of them are not in the "debug" level. So will there be another problem? Also, I found that the mod_jk.log file is wierd, since most log files will display date/time and what happened, but mod_jk.log doesn't. It displays something like:

[jk_uri_worker_map.c (156)]: Into jk_uri_worker_map_t::uri_worker_map_alloc

[jk_uri_worker_map.c (196)]: Into jk_uri_worker_map_t::uri_worker_map_open

[jk_uri_worker_map.c (211)]: jk_uri_worker_map_t::uri_worker_map_open, rule map

size is 0

Is it normal? Thanks again in advance.

GMU at 2007-6-29 3:18:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Hi, can anyone give me a few lines of the mod_jk.log file? I want to see if our mod_jk.log file is normal since it doesn't display date/time like most of the other log files do. Thanks in advance.
GMU at 2007-6-29 3:18:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

This is what mine looks like:[jk_uri_worker_map.c (344)]: Into jk_uri_worker_map_t::map_uri_to_worker

[jk_uri_worker_map.c (434)]: jk_uri_worker_map_t::map_uri_to_worker, done without$

[jk_uri_worker_map.c (344)]: Into jk_uri_worker_map_t::map_uri_to_worker

[jk_uri_worker_map.c (434)]: jk_uri_worker_map_t::map_uri_to_worker, done without$

[jk_uri_worker_map.c (344)]: Into jk_uri_worker_map_t::map_uri_to_worker

If it is expanding that fast and it is set to a lower log level that does make it sound a little like something funny is going on- try doing a fairly precise search on google- that usually has an index of the mailing lists that covers most odd problems that people encouter.

Breakfast at 2007-6-29 3:18:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Thanks again, Breakfast. One more question: What's the approx. size of your mod_jk.log file by running Apache + Tomcat for about 20 minutes? Or can you tell me the size of your mod_jk.log and how long you have been running it? Many thanks.
GMU at 2007-6-29 3:18:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
Last time I looked at it, it was about 927 lines. As it doesn't record a date/time I cant tell how long that is for, but I don't recall emptying it, so its probably 3-4 months to get that far.
Breakfast at 2007-6-29 3:18:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8

Thanks again and again :)

Well, our mod_jk.log file is 28854 lines for just running about 20 minutes. It's definetly not normal..... Looks like we did something wrong while installing/configuring....... Anyway, I will look at other resources for some solutons/explaination. I have joined the tomcat-user mailing list, so far, no luck......

Again, thanks very much.

GMU at 2007-6-29 3:18:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9

Hi

I was looking for solution on how to make Apache and Tomcat work together. On HP-UX System 11, I have Apache and Tomcat installed. They both individually. But I would like use Apache to route servlet and jsp reuests to Tomcat. Could you help me to the right direction ? gkadery@avmed.org.

gkadery at 2007-6-29 3:18:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...