You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ja...@providian.com on 2001/05/03 00:01:35 UTC

JSP re-compile performance under heavy load


I am considering a design where a thread calls a  long running query, uses
the results to generate a JSP and then write the new JSP over the old JSP.
Tomcat would then notice the update, recompile the JSP and display the new
query results.  The query/rewrite would happen once every 10 minutes.  The
query could take up to a minute to run.

Will tomcat do this acceptably if the server is under heavy load?  If this
would create a performance/memory problem, is there anything in my code
that could be done to minimize it?  Is there any help I could provide in
the Tomcat code to optimize this?  (I've never coded anything for Tomcat,
but I'd love an excuse to get involved)

I know that JSP re-compilation is not generally used as a production
feature.  Could it be reasonably used this way, or am I better off to
examine another avenue?  (Such as holding the results in memory and
re-printing them for each request, which would be memory prohibitive)

Thanks,
                                                   Jason Henriksen



------------------------------------------------------------------------------
Warning : The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this message and then delete it from your computer. All e-mail sent to this address will be received by the Providian Financial corporate e-mail system and is subject to archiving and review by someone other than the recipient.

==============================================================================


Re: Tomcat, IIS and virtual hosts

Posted by Sachin Phatak <sa...@podc.com>.
Hi!
This Post by Robert was helpful I tried it and it works. But i have a few
more Qs.

Q 1. The Documentation mentions that to add contexts to the IIS we  need to
add contexts in uriworkermap.properties (a file totaly ignored in Robert's
solution). Any idea whether that needs to be done at all & if so in what
situation?

Q 2. In the <Host> ... </Host> entry of server.xml, we create a Context with
path="xyz" & docBase="webapps/contextname". What should one do if teh
context is to be mapped to a directory outside "c:\jakarta-tomcat\webapps\"
say maybe on "d:\webapps\"

Q3. Are there any benefits to running multiple instances of tomcat for each
virtual host. If yes how does one run multiple instances?

thanks
sachin

----- Original Message -----
From: Robert J. Lebowitz <le...@finaltouch.com>
To: <to...@jakarta.apache.org>
Sent: Friday, May 04, 2001 12:23 AM
Subject: Re: Tomcat, IIS and virtual hosts


> I finally solved the problem of virtual hosts on IIS myself.... it took a
> bit of time, and I had to re-read the Tomcat documentation quite a bit.
It
> might be useful to have an example as there is for the Apache server in
> there in the future.
>
> I had to modify to files to allow me to connect properly to my virtual
> hosts:
>
> 1.  server.xml - use the <Host name="myhost.org">
> </Host> section to define an appropriate context for the virtual host.
> Supposedly you can specify either the fully qualified hostname, or it's IP
> address in the name attribute.
>
> 2.  workers.properties.  This is the part that had me stumped for quite a
> while.  I had to redefine the host associated with the ajp12 worker.  I
> suppose that if I wanted to retain the localhost setting, I could define
> another worker in the worker.list, make sure it is of type ajp12, and
assign
> it's .host attribute with the name of my virtual host, and it's port as
> 8007.
>
> here's an example.
>
> In the uriworkers.properties file it's important to assign the correct
> worker to the URL path name you're using for that virtual host... since I
> used ajp12, I didn't have to do much there...
>
> #
> # Defining a worker named ajp12 and of type ajp12
> # Note that the name and the type do not have to match.
> #
> worker.list=ajp12, ajp13
> worker.ajp12.port=8007
> #worker.ajp12.host=localhost
> worker.ajp12.host=myhost.org
> worker.ajp12.type=ajp12
>
>


Re: Tomcat, IIS and virtual hosts

Posted by "Robert J. Lebowitz" <le...@finaltouch.com>.
I finally solved the problem of virtual hosts on IIS myself.... it took a
bit of time, and I had to re-read the Tomcat documentation quite a bit.  It
might be useful to have an example as there is for the Apache server in
there in the future.

I had to modify to files to allow me to connect properly to my virtual
hosts:

1.  server.xml - use the <Host name="myhost.org">
</Host> section to define an appropriate context for the virtual host.
Supposedly you can specify either the fully qualified hostname, or it's IP
address in the name attribute.

2.  workers.properties.  This is the part that had me stumped for quite a
while.  I had to redefine the host associated with the ajp12 worker.  I
suppose that if I wanted to retain the localhost setting, I could define
another worker in the worker.list, make sure it is of type ajp12, and assign
it's .host attribute with the name of my virtual host, and it's port as
8007.

here's an example.

In the uriworkers.properties file it's important to assign the correct
worker to the URL path name you're using for that virtual host... since I
used ajp12, I didn't have to do much there...

#
# Defining a worker named ajp12 and of type ajp12
# Note that the name and the type do not have to match.
#
worker.list=ajp12, ajp13
worker.ajp12.port=8007
#worker.ajp12.host=localhost
worker.ajp12.host=myhost.org
worker.ajp12.type=ajp12



Tomcat, IIS and virtual hosts

Posted by "Robert J. Lebowitz" <le...@finaltouch.com>.
I recently installed Tomcat 3.2.1 on an NT 4.0 server running IIS according
to Gil Shachor's directions, using JavaService to install it as an NT
Service.  Everything worked exactly as it supposed to; my JSPs are working
fine.

However, on a separate NT 4.0 server, following the same directions, I've
been unable to get the server to redirect correctly.  I know that Tomcat is
running because I can call up my JSPs and the Tomcat examples using:

http://localhost:8080/examples/jsp/index.html

However, what I really want is to be able to use the URL

http://localhost/examples/jsp/index.html


I realized that primary difference between the two servers is that one runs
virtual hosts.  I suspect that the configuration for Tomcat on IIS must be
different when you have virtual hosts.  I've looked for examples in the
documentation, but haven't found any; most examples seem to be geared for
Apache.  I discovered the <Host/> directive for server.xml, but my efforts
at getting it to work failed.

Can someone send me an example of how to configure Tomcat to work with
virtual hosts?

Rob