You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jilles van Gurp <in...@jillesvangurp.com> on 2005/09/23 16:46:30 UTC
tld processing performance at startup
Hi,
I have a large site running on tomcat with some tag libs. Restarting
tomcat can take up to 30-40 seconds which is not that bad except that
we'd prefer to minimize this time because apache can queue a lot of
incoming requests in this 30 seconds. We need to restart often because
we are still tinkering with the site even though it already went live.
In general, shorter startup times would be really nice anyhow.
Some analysis of what is taking up most of this time has shown that
tomcat is spending a lot of time (>40-50%) processing all the files in
the web application looking for tld descriptors. In this particular web
application there a few thousand small files (e.g. xml descriptors,
jsps, some static stuff, lots of scripts, etc). Only a small subset is
jar files (about 20) and only about ten of the files are actually tlds,
all conveniently located in a subdirectory of WEB-INF. The whole thing
is deployed as an unzipped directory rather than a war file so we can
update stuff faster (copy some jar files, stop/start). Auto reload is
not compatible with our web app so we don't have that enabled.
This web log post:
http://www.webweavertech.com/costin/archives/000164.html suggests that
the reason for the poor performance may be a design flaw in the jsp spec
which makes it necessary to do a lot of work. The ideal way would be for
the tld descriptors to always be in the META-INF directory. However, the
spec doesn't require this and tlds may be located anywhere in the
webapplication. Is this analysis of the problem still correct for tomcat
5.0.28?
On the other hand the web.xml does specify explicitly where the tlds are
so I don't fully understand the need to look through the whole web
application directory.
Is there a way to optimize this problem away (even partially) by e.g.
telling tomcat explicitly what tlds to process?
Regards,
Jilles van Gurp
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: tld processing performance at startup
Posted by Peter Rossbach <pr...@objektpark.de>.
Setup a META-INF/context.xml inside your app
<Context processTlds="false" />
And check Tim's tipps :-)
regards
Peter
Tim Funk schrieb:
> There is an option to disable TLD processing. This is nice if:
> 1) You precompile
> 2) Or don't use tld files
>
>
> See
> http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html
> for disabling them
>
> If you place listeners in your TLD files - I am unsure if they are
> picked up if the TLD is explicitly listed in web.xml. If not - you can
> place the listener explicitly in web.xml.
>
>
> -Tim
>
> Jilles van Gurp wrote:
>
>> Hi,
>>
>> I have a large site running on tomcat with some tag libs. Restarting
>> tomcat can take up to 30-40 seconds which is not that bad except that
>> we'd prefer to minimize this time because apache can queue a lot of
>> incoming requests in this 30 seconds. We need to restart often
>> because we are still tinkering with the site even though it already
>> went live. In general, shorter startup times would be really nice
>> anyhow.
>>
>> Some analysis of what is taking up most of this time has shown that
>> tomcat is spending a lot of time (>40-50%) processing all the files
>> in the web application looking for tld descriptors. In this
>> particular web application there a few thousand small files (e.g. xml
>> descriptors, jsps, some static stuff, lots of scripts, etc). Only a
>> small subset is jar files (about 20) and only about ten of the files
>> are actually tlds, all conveniently located in a subdirectory of
>> WEB-INF. The whole thing is deployed as an unzipped directory rather
>> than a war file so we can update stuff faster (copy some jar files,
>> stop/start). Auto reload is not compatible with our web app so we
>> don't have that enabled.
>>
>> This web log post:
>> http://www.webweavertech.com/costin/archives/000164.html suggests
>> that the reason for the poor performance may be a design flaw in the
>> jsp spec which makes it necessary to do a lot of work. The ideal way
>> would be for the tld descriptors to always be in the META-INF
>> directory. However, the spec doesn't require this and tlds may be
>> located anywhere in the webapplication. Is this analysis of the
>> problem still correct for tomcat 5.0.28?
>>
>> On the other hand the web.xml does specify explicitly where the tlds
>> are so I don't fully understand the need to look through the whole
>> web application directory.
>>
>> Is there a way to optimize this problem away (even partially) by e.g.
>> telling tomcat explicitly what tlds to process?
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: tld processing performance at startup
Posted by Tim Funk <fu...@joedog.org>.
There is an option to disable TLD processing. This is nice if:
1) You precompile
2) Or don't use tld files
See http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html for
disabling them
If you place listeners in your TLD files - I am unsure if they are picked up
if the TLD is explicitly listed in web.xml. If not - you can place the
listener explicitly in web.xml.
-Tim
Jilles van Gurp wrote:
> Hi,
>
> I have a large site running on tomcat with some tag libs. Restarting
> tomcat can take up to 30-40 seconds which is not that bad except that
> we'd prefer to minimize this time because apache can queue a lot of
> incoming requests in this 30 seconds. We need to restart often because
> we are still tinkering with the site even though it already went live.
> In general, shorter startup times would be really nice anyhow.
>
> Some analysis of what is taking up most of this time has shown that
> tomcat is spending a lot of time (>40-50%) processing all the files in
> the web application looking for tld descriptors. In this particular web
> application there a few thousand small files (e.g. xml descriptors,
> jsps, some static stuff, lots of scripts, etc). Only a small subset is
> jar files (about 20) and only about ten of the files are actually tlds,
> all conveniently located in a subdirectory of WEB-INF. The whole thing
> is deployed as an unzipped directory rather than a war file so we can
> update stuff faster (copy some jar files, stop/start). Auto reload is
> not compatible with our web app so we don't have that enabled.
>
> This web log post:
> http://www.webweavertech.com/costin/archives/000164.html suggests that
> the reason for the poor performance may be a design flaw in the jsp spec
> which makes it necessary to do a lot of work. The ideal way would be for
> the tld descriptors to always be in the META-INF directory. However, the
> spec doesn't require this and tlds may be located anywhere in the
> webapplication. Is this analysis of the problem still correct for tomcat
> 5.0.28?
>
> On the other hand the web.xml does specify explicitly where the tlds are
> so I don't fully understand the need to look through the whole web
> application directory.
>
> Is there a way to optimize this problem away (even partially) by e.g.
> telling tomcat explicitly what tlds to process?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org