You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Shane Witbeck <sh...@digitalsanctum.com> on 2007/08/21 14:10:22 UTC

20 Tips for Using Tomcat in Production

I thought my latest blog post would be of interest to the people on this list:

http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Java servlets

Posted by David Smith <dn...@cornell.edu>.
Well... has anything been written to the response before the forward?  
If so, that'll do it. 

If what you really want is to include the output of various servlets and 
jsps in one response, you really need an aggrigator servlet that pulls 
together the output of various servlets.  In jsp land, the c:import tag 
will do exactly this sort of thing.

--David

Deepa Paranjpe wrote:
> Hi all, 
>  
>  This is not a question specific to tomcat but more about servlets. 
>  I am using a dispatcher forward to invoke another servlet. 
>  Why do I get an exception --> java.lang.IllegalStateException: Cannot forward after response has been committed
>  
>  For some reason I am unable to find good documentation to do complicated servlets invocations. Does any one know?
>  
>  
>  
> Ole Ersoy <ol...@gmail.com> wrote:Incidentally - since we are talking about pooling - should the executor configuration be a tip? It allows the connectors to share a single thread pool, rather than each connector having its own. This seems like a memory and performance slurpee to me.
>
> Cheers,
> - Ole
>
> myrealbruno wrote:
>   
>> IMHO the only good reason to move a library out from an application and
>> place it into /common/lib (or /lib) is to get advantage of connection
>> pooling.
>> http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html
>>
>> Then, yes, if you have different database versions you might find yourself
>> in the usual library versions nightmare.. :-)
>>
>> -----Original Message-----
>> From: Diego Yasuhiko Kurisaki [mailto:diegoy@gmail.com] 
>> Sent: 22 August 2007 00:35
>> To: Tomcat Users List
>> Subject: Re: 20 Tips for Using Tomcat in Production
>>
>>
>> I agree, i'm not willing to pay the management overhead of putting my shared
>> libraries to the tomcat common lib, unless my gains are very big in terms of
>> memory consumption.
>>
>> I don't really think you should change for another one though, but you can
>> make regards about the cons of that approach.
>>
>> Anyway, great work 5 stars.
>>
>>
>> On 8/21/07, Ben Souther  wrote:
>>     
>>>                              From:
>>> Christopher Schultz
>>>       
>>>> I also agree with David and, uh, David, that #6 is a little dubious. 
>>>> Yes, moving shared libraries into the common/lib directory will save 
>>>> you some memory, but it creates a management headache when it comes 
>>>> to version numbers, WAR packaging, etc. Ideally, the WAR contains 
>>>> everything the webapp needs. If you rely on the servlet container to 
>>>> provide essential libraries, you are changing your deployment 
>>>> strategy significantly.
>>>>         
>>> +1
>>>
>>> Starting with Servlet Spec 2.3 (I think) there has been an emphasis on 
>>> putting everything a web app needs to run into its war file. To put 
>>> include something that runs contrary to this 'best practice' in an 
>>> article of tips at this point in time doesn't sound like a good idea.
>>>
>>> I would seriously consider replacing that one with something else.
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>       
>>     
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>        
> ---------------------------------
> Boardwalk for $500? In 2007? Ha! 
> Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Java servlets

Posted by Glenn McCall <gl...@gtajb.com>.
In a nutshell, once you forward you should ensure nothing else is sent to the output. Similarly once you start outputing a page, don't change your mind and forward.

Thus your code should look something like this:

        if (errorMessage != null) {
            response.sendRedirect (request.getContextPath() + "/someotherpage.jsp")  ;
            return;
        }
        out.println ("<html>");
        ...

Not like this:
        if (errorMessage != null) {
            response.sendRedirect (request.getContextPath() + "/someotherpage.jsp")  ;
        }

        out.println ("<html>");
        ...

This is a common mistake.

I suspect that you are doing the reverse with the exception you are getting. That is you are doing this:
        out.println ("<html>");
        ...
        if (somethingBadHasHappened) {
            errorMessage = "Uh Oh, something bad has happened.";
        }
        ...
        if (errorMessage != null) {
            response.sendRedirect (request.getContextPath() + "/someotherpage.jsp")  ;
        }

As for documentation, there are a great many titles on Servlets at the local book store. Also try searching the web there are plenty of tutorials and samples out there.

I hope this helps

Glenn Mc



----- Original Message ----- 
From: "Deepa Paranjpe" <de...@yahoo.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, August 30, 2007 10:01 AM
Subject: Java servlets


> Hi all, 
> 
> This is not a question specific to tomcat but more about servlets. 
> I am using a dispatcher forward to invoke another servlet. 
> Why do I get an exception --> java.lang.IllegalStateException: Cannot forward after response has been committed
> 
> For some reason I am unable to find good documentation to do complicated servlets invocations. Does any one know?
> 
> 
> 
> Ole Ersoy <ol...@gmail.com> wrote:Incidentally - since we are talking about pooling - should the executor configuration be a tip? It allows the connectors to share a single thread pool, rather than each connector having its own. This seems like a memory and performance slurpee to me.
> 
> Cheers,
> - Ole
> 

Java servlets

Posted by Deepa Paranjpe <de...@yahoo.com>.
Hi all, 
 
 This is not a question specific to tomcat but more about servlets. 
 I am using a dispatcher forward to invoke another servlet. 
 Why do I get an exception --> java.lang.IllegalStateException: Cannot forward after response has been committed
 
 For some reason I am unable to find good documentation to do complicated servlets invocations. Does any one know?
 
 
 
Ole Ersoy <ol...@gmail.com> wrote:Incidentally - since we are talking about pooling - should the executor configuration be a tip? It allows the connectors to share a single thread pool, rather than each connector having its own. This seems like a memory and performance slurpee to me.

Cheers,
- Ole

myrealbruno wrote:
> IMHO the only good reason to move a library out from an application and
> place it into /common/lib (or /lib) is to get advantage of connection
> pooling.
> http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html
> 
> Then, yes, if you have different database versions you might find yourself
> in the usual library versions nightmare.. :-)
> 
> -----Original Message-----
> From: Diego Yasuhiko Kurisaki [mailto:diegoy@gmail.com] 
> Sent: 22 August 2007 00:35
> To: Tomcat Users List
> Subject: Re: 20 Tips for Using Tomcat in Production
> 
> 
> I agree, i'm not willing to pay the management overhead of putting my shared
> libraries to the tomcat common lib, unless my gains are very big in terms of
> memory consumption.
> 
> I don't really think you should change for another one though, but you can
> make regards about the cons of that approach.
> 
> Anyway, great work 5 stars.
> 
> 
> On 8/21/07, Ben Souther  wrote:
>>                              From:
>> Christopher Schultz
>>> I also agree with David and, uh, David, that #6 is a little dubious. 
>>> Yes, moving shared libraries into the common/lib directory will save 
>>> you some memory, but it creates a management headache when it comes 
>>> to version numbers, WAR packaging, etc. Ideally, the WAR contains 
>>> everything the webapp needs. If you rely on the servlet container to 
>>> provide essential libraries, you are changing your deployment 
>>> strategy significantly.
>> +1
>>
>> Starting with Servlet Spec 2.3 (I think) there has been an emphasis on 
>> putting everything a web app needs to run into its war file. To put 
>> include something that runs contrary to this 'best practice' in an 
>> article of tips at this point in time doesn't sound like a good idea.
>>
>> I would seriously consider replacing that one with something else.
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



       
---------------------------------
Boardwalk for $500? In 2007? Ha! 
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.

Re: 20 Tips for Using Tomcat in Production

Posted by Ole Ersoy <ol...@gmail.com>.
Incidentally - since we are talking about pooling - should the executor configuration be a tip?  It allows the connectors to share a single thread pool, rather than each connector having its own.  This seems like a memory and performance slurpee to me.

Cheers,
- Ole

myrealbruno wrote:
> IMHO the only good reason to move a library out from an application and
> place it into /common/lib (or /lib) is to get advantage of connection
> pooling.
> http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html
> 
> Then, yes, if you have different database versions you might find yourself
> in the usual library versions nightmare.. :-)
> 
> -----Original Message-----
> From: Diego Yasuhiko Kurisaki [mailto:diegoy@gmail.com] 
> Sent: 22 August 2007 00:35
> To: Tomcat Users List
> Subject: Re: 20 Tips for Using Tomcat in Production
> 
> 
> I agree, i'm not willing to pay the management overhead of putting my shared
> libraries to the tomcat common lib, unless my gains are very big in terms of
> memory consumption.
> 
> I don't really think you should change for another one though, but you can
> make regards about the cons of that approach.
> 
> Anyway, great work 5 stars.
> 
> 
> On 8/21/07, Ben Souther <be...@souther.us> wrote:
>>                              From:
>> Christopher Schultz
>>> I also agree with David and, uh, David, that #6 is a little dubious. 
>>> Yes, moving shared libraries into the common/lib directory will save 
>>> you some memory, but it creates a management headache when it comes 
>>> to version numbers, WAR packaging, etc. Ideally, the WAR contains 
>>> everything the webapp needs. If you rely on the servlet container to 
>>> provide essential libraries, you are changing your deployment 
>>> strategy significantly.
>> +1
>>
>> Starting with Servlet Spec 2.3 (I think) there has been an emphasis on 
>> putting everything a web app needs to run into its war file. To put 
>> include something that runs contrary to this 'best practice' in an 
>> article of tips at this point in time doesn't sound like a good idea.
>>
>> I would seriously consider replacing that one with something else.
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: 20 Tips for Using Tomcat in Production

Posted by myrealbruno <my...@myrealbox.com>.
IMHO the only good reason to move a library out from an application and
place it into /common/lib (or /lib) is to get advantage of connection
pooling.
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html

Then, yes, if you have different database versions you might find yourself
in the usual library versions nightmare.. :-)

-----Original Message-----
From: Diego Yasuhiko Kurisaki [mailto:diegoy@gmail.com] 
Sent: 22 August 2007 00:35
To: Tomcat Users List
Subject: Re: 20 Tips for Using Tomcat in Production


I agree, i'm not willing to pay the management overhead of putting my shared
libraries to the tomcat common lib, unless my gains are very big in terms of
memory consumption.

I don't really think you should change for another one though, but you can
make regards about the cons of that approach.

Anyway, great work 5 stars.


On 8/21/07, Ben Souther <be...@souther.us> wrote:
>
>                              From:
> Christopher Schultz
> > I also agree with David and, uh, David, that #6 is a little dubious. 
> > Yes, moving shared libraries into the common/lib directory will save 
> > you some memory, but it creates a management headache when it comes 
> > to version numbers, WAR packaging, etc. Ideally, the WAR contains 
> > everything the webapp needs. If you rely on the servlet container to 
> > provide essential libraries, you are changing your deployment 
> > strategy significantly.
>
> +1
>
> Starting with Servlet Spec 2.3 (I think) there has been an emphasis on 
> putting everything a web app needs to run into its war file. To put 
> include something that runs contrary to this 'best practice' in an 
> article of tips at this point in time doesn't sound like a good idea.
>
> I would seriously consider replacing that one with something else.
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Diego Yasuhiko Kurisaki



---AV & Spam Filtering by M+Guardian - Risk Free Email (TM)---


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Diego Yasuhiko Kurisaki <di...@gmail.com>.
I agree, i'm not willing to pay the management overhead of putting my shared
libraries to the tomcat common lib, unless my gains are very big in terms of
memory consumption.

I don't really think you should change for another one though, but you can
make regards about the cons of that approach.

Anyway, great work 5 stars.


On 8/21/07, Ben Souther <be...@souther.us> wrote:
>
>                              From:
> Christopher Schultz
> > I also agree with David and, uh, David, that #6 is a little dubious.
> > Yes, moving shared libraries into the common/lib directory will save you
> > some memory, but it creates a management headache when it comes to
> > version numbers, WAR packaging, etc. Ideally, the WAR contains
> > everything the webapp needs. If you rely on the servlet container to
> > provide essential libraries, you are changing your deployment strategy
> > significantly.
>
> +1
>
> Starting with Servlet Spec 2.3 (I think) there has been an emphasis on
> putting everything a web app needs to run into its war file.
> To put include something that runs contrary to this 'best practice' in
> an article of tips at this point in time doesn't sound like a good idea.
>
> I would seriously consider replacing that one with something else.
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Diego Yasuhiko Kurisaki

Re: 20 Tips for Using Tomcat in Production

Posted by Ben Souther <be...@souther.us>.
                             From: 
Christopher Schultz
> I also agree with David and, uh, David, that #6 is a little dubious.
> Yes, moving shared libraries into the common/lib directory will save you
> some memory, but it creates a management headache when it comes to
> version numbers, WAR packaging, etc. Ideally, the WAR contains
> everything the webapp needs. If you rely on the servlet container to
> provide essential libraries, you are changing your deployment strategy
> significantly.

+1

Starting with Servlet Spec 2.3 (I think) there has been an emphasis on
putting everything a web app needs to run into its war file.
To put include something that runs contrary to this 'best practice' in
an article of tips at this point in time doesn't sound like a good idea.

I would seriously consider replacing that one with something else.




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Shane Witbeck <sh...@digitalsanctum.com>.
Chris,

Yes I agree that the extent at which #6 is implemented probably
depends a lot on the size of the app (namely the number of libraries).

There's already a link to the Tomcat original documentation for #3
although I noticed I forgot the link for #2.

Thanks for the comments,

Shane


On 8/21/07, Christopher Schultz <ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Shane,
>
> Shane Witbeck wrote:
> > I thought my latest blog post would be of interest to the people on this list:
>
> I like the list. Could you provide references where appropriate? For
> instance, you reference the Tomcat documentation in point #3, but don't
> provide a link to the original documentation so readers can see it in
> context.
>
> I also agree with David and, uh, David, that #6 is a little dubious.
> Yes, moving shared libraries into the common/lib directory will save you
> some memory, but it creates a management headache when it comes to
> version numbers, WAR packaging, etc. Ideally, the WAR contains
> everything the webapp needs. If you rely on the servlet container to
> provide essential libraries, you are changing your deployment strategy
> significantly.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGyvEd9CaO5/Lv0PARAkgHAKC+r4J+CMqaBtkBu52zw++/duGmngCglRuk
> Zjl7KeAJuD2q1xKhbUTjVxw=
> =C4Nf
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Thank you,

Shane Witbeck
Digital Sanctum, inc.
-----------------------------------------------------
skype: digitalsanctum
  blog: http://www.digitalsanctum.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shane,

Shane Witbeck wrote:
> I thought my latest blog post would be of interest to the people on this list:

I like the list. Could you provide references where appropriate? For
instance, you reference the Tomcat documentation in point #3, but don't
provide a link to the original documentation so readers can see it in
context.

I also agree with David and, uh, David, that #6 is a little dubious.
Yes, moving shared libraries into the common/lib directory will save you
some memory, but it creates a management headache when it comes to
version numbers, WAR packaging, etc. Ideally, the WAR contains
everything the webapp needs. If you rely on the servlet container to
provide essential libraries, you are changing your deployment strategy
significantly.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGyvEd9CaO5/Lv0PARAkgHAKC+r4J+CMqaBtkBu52zw++/duGmngCglRuk
Zjl7KeAJuD2q1xKhbUTjVxw=
=C4Nf
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Lyallex <ly...@gmail.com>.
Good stuff

I'm doing 70% of what you suggest and Tomcat 5.5.20 hums along nicely
on Debian Linux
with Java 1.5.0_04

I bet this one runs and runs ...

Rgds
Duncan

On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
> I thought my latest blog post would be of interest to the people on this list:
>
> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shane,

Shane Witbeck wrote:
> You can actually use JAVA_OPTS or CATALINA_OPTS to add the options and
> the options only apply to JDK 1.5 or above. I don't think the version
> of Tomcat matters here.

There is a (minor) difference between the two: JAVA_OPTS will always be
passed to the Java process (including a "stop" command), while
CATALINA_OPTS will only be passed when you use the "start" and "run"
commands.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGy15a9CaO5/Lv0PARApoOAJ9VANwQ8wPJnrAtSluG9g+KJ5/cbgCgoVH0
CZiSJdduRHree380Y5UraVY=
=8P48
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Shane Witbeck <sh...@digitalsanctum.com>.
You can actually use JAVA_OPTS or CATALINA_OPTS to add the options and
the options only apply to JDK 1.5 or above. I don't think the version
of Tomcat matters here.

Shane


On 8/21/07, Kim Albee <mt...@gmail.com> wrote:
> In putting #1 into the JAVA_OPTS (which it appears that is the CATALINA_OPTS
> for our implementation), it doesn't appear to work, as Tomcat doesn't
> restart.  It could be our version -- which is currently 5.0.30.  please let
> me know if there are other steps we need to take here as well.
>
> thanks,
> Kim :-)
>
> On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
> >
> > I thought my latest blog post would be of interest to the people on this
> > list:
> >
> >
> > http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>


-- 
Thank you,

Shane Witbeck
Digital Sanctum, inc.
-----------------------------------------------------
skype: digitalsanctum
  blog: http://www.digitalsanctum.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: 20 Tips for Using Tomcat in Production

Posted by Karel Sedlacek <kv...@cornell.edu>.
Thank you, we are running Windows,... will check the Service properties.

At 09:55 AM 8/22/2007, you wrote:
> > From: Leon Rosenberg [mailto:rosenberg.leon@googlemail.com]
> > Subject: Re: 20 Tips for Using Tomcat in Production
> >
> > as far as i know this option is outdated, hence the vm automatically
> > goes into server mode if it detects a server class machine (>=2GB RAM,
> > 2 processors (which also includes ht or dualcore)
>
>The automatic mode switch based on platform configuration occurs only
>when using the standard java launcher.  If running as a Windows service,
>the selection of the server or client .dll must be done explicitly in
>the service properties.
>
>  - Chuck
>
>
>THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
>MATERIAL and is thus for use only by the intended recipient. If you
>received this in error, please contact the sender and delete the e-mail
>and its attachments from all computers.
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org

Karel Sedlacek                                          kvs1@cornell.edu
CIT Data Administration                                 Phn 607-255-7742
Cornell University                                              Fax 
607-255-1297
Ithaca, NY 14853 



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: 20 Tips for Using Tomcat in Production

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Leon Rosenberg [mailto:rosenberg.leon@googlemail.com] 
> Subject: Re: 20 Tips for Using Tomcat in Production
> 
> as far as i know this option is outdated, hence the vm automatically
> goes into server mode if it detects a server class machine (>=2GB RAM,
> 2 processors (which also includes ht or dualcore)

The automatic mode switch based on platform configuration occurs only
when using the standard java launcher.  If running as a Windows service,
the selection of the server or client .dll must be done explicitly in
the service properties.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Ole Ersoy <ol...@gmail.com>.
Chuck and Chris,

Thank you for the tips!  I'll probably code a little servlet that has a peak, but now that I'm aware of Lambda Probe, I just have to play with it :-)  Extremely cool toy!

Thanks again,
- Ole


Caldarale, Charles R wrote:
>> From: Christopher Schultz [mailto:chris@christopherschultz.net] 
>> Subject: Re: 20 Tips for Using Tomcat in Production
>>
>> Or just look at the value for the system property "java.vm.name".
> 
> Yes, that's exactly what both JConsole and Lambda Probe do; I was just
> trying to suggest a mechanism that didn't require writing additional
> code.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: 20 Tips for Using Tomcat in Production

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christopher Schultz [mailto:chris@christopherschultz.net] 
> Subject: Re: 20 Tips for Using Tomcat in Production
> 
> Or just look at the value for the system property "java.vm.name".

Yes, that's exactly what both JConsole and Lambda Probe do; I was just
trying to suggest a mechanism that didn't require writing additional
code.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck and Ole,

Caldarale, Charles R wrote:
>> From: Ole Ersoy [mailto:ole.ersoy@gmail.com] 
>> Subject: Re: 20 Tips for Using Tomcat in Production
>>
>> Anyone know if there is a way to verify that the 
>> jvm is running in server mode?
> 
> Enable JMX and use JConsole to look inside, or install Lambda Probe and
> look at its System Information tab.  Get Lambda Probe from here:
> http://www.lambdaprobe.org

Or just look at the value for the system property "java.vm.name". It
should either say "Client" or "Server" somewhere in there (at least when
using a Sun VM).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG1CKX9CaO5/Lv0PARAkV7AKDDs/bTF34kI4wvoZA8gCOYBM1XyQCghXgO
e4NZ5zkjCv1wDdFfJ4fRCs0=
=3sG/
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: 20 Tips for Using Tomcat in Production

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ole Ersoy [mailto:ole.ersoy@gmail.com] 
> Subject: Re: 20 Tips for Using Tomcat in Production
> 
> Anyone know if there is a way to verify that the 
> jvm is running in server mode?

Enable JMX and use JConsole to look inside, or install Lambda Probe and
look at its System Information tab.  Get Lambda Probe from here:
http://www.lambdaprobe.org

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Ole Ersoy <ol...@gmail.com>.
Hi,

I ran ./jsvc help and notice it had a -jvm option.  So I tried this:

CATALINA_HOME=/usr/share/apache-tomcat
JAVA_HOME=/usr/lib/jvm/java
DAEMON_LAUNCHER=$CATALINA_HOME/bin/jsvc
TOMCAT_USER=tomcat
TMP_DIR=/var/cache/apache-tomcat/temp
CLASSPATH=$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/bin/commons-daemon.jar:$CATALINA_HOME/bin/bootstrap.jar

case "$1" in
  start)
    #
    # Start Tomcat
    #
    echo -n "Starting tomcat"
    echo
    $DAEMON_LAUNCHER \
    -jvm server \ #<<<<<<<<<<<<This is the good part
    -user $TOMCAT_USER \
    -home $JAVA_HOME \
    -Dcatalina.home=$CATALINA_HOME \
    -Djava.io.tmpdir=$TMP_DIR \
    -outfile $CATALINA_HOME/logs/catalina.out \
    -errfile '&1' \
    -cp $CLASSPATH \
    org.apache.catalina.startup.Bootstrap
    #
    # To get a verbose JVM
    #-verbose     # To get a debug of jsvc.
    #-debug
    ;;

And jsvc seems to be cool with it.  Anyone know if there is a way to verify that the jvm is running in server mode?

Thanks,
- Ole



Ole Ersoy wrote:
> Hi,
> 
> I'm trying to get the -server option working with jsvc.  When inserting 
> -server I get this:
> 
> [root@ole init.d]# service tomcat start
> Starting tomcat
> 27/08/2007 21:11:08 10371 jsvc error: Invalid option -server
> 27/08/2007 21:11:08 10371 jsvc error: Cannot parse command line arguments
> 
> The script looks like this (Note that if I remove "-server" tomcat start 
> fine):
> 
> CATALINA_HOME=/usr/share/apache-tomcat
> JAVA_HOME=/usr/lib/jvm/java
> DAEMON_LAUNCHER=$CATALINA_HOME/bin/jsvc
> TOMCAT_USER=tomcat
> TMP_DIR=/var/cache/apache-tomcat/temp
> CATALINA_OPTS=-server
> CLASSPATH=$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/bin/commons-daemon.jar:$CATALINA_HOME/bin/bootstrap.jar 
> 
> 
> case "$1" in
>  start)
>    #
>    # Start Tomcat
>    #
>    echo -n "Starting tomcat"
>    echo
>    $DAEMON_LAUNCHER -server \
>    -user $TOMCAT_USER \
>    -home $JAVA_HOME \
>    -Dcatalina.home=$CATALINA_HOME \
>    -Djava.io.tmpdir=$TMP_DIR \
>    -outfile $CATALINA_HOME/logs/catalina.out \
>    -errfile '&1' \
>    -cp $CLASSPATH \
>    org.apache.catalina.startup.Bootstrap
>    #
>    # To get a verbose JVM
>    #-verbose     # To get a debug of jsvc.
>    #-debug
>    ;;
> 
> Any ideas?
> 
> Thanks,
> - Ole
> 
> 
> 
> 
> Karel Sedlacek wrote:
>> OK, let me give this a whirl.
>>
>> Karel
>>
>> At 09:20 AM 8/22/2007, you wrote:
>>> See the table in this page. On Windows on i586 java always defaults 
>>> to client runtime. (amd64 or ia-64 are different)
>>> http://java.sun.com/docs/hotspot/gc5.0/ergo5.html
>>>
>>> If you can set JAVA_OPTS=-server java starts with it. Print 
>>> System.getProperties() and you can see what runtime is used.
>>>
>>> Ronald.
>>>
>>> On Wed Aug 22 14:15:27 CEST 2007 Tomcat Users List 
>>> <us...@tomcat.apache.org> wrote:
>>>> I am running a 4 core, 8GB, Server 2003 SP1 EE (not R2) machine.
>>>> One JRE: 1.5.0_09
>>>> Karel
>>>> > as far as i know this option is outdated, hence the vm automatically
>>>> > goes into server mode if it detects a server class machine (>=2GB 
>>>> RAM,
>>>> > 2 processors (which also includes ht or dualcore)
>>>> >
>>>> > leon
>>>> >
>>>> > maybe wrong though
>>>> >
>>>> > On 8/22/07, Ben Souther <be...@souther.us> wrote:
>>>> >> It depends on which operating system you're using and how you've
>>>> >> installed Tomcat.
>>>> >> Can you tell us which it is?
>>>> >>
>>>> >>
>>>> >>
>>>> >> On Wed, 2007-08-22 at 07:19, Karel V Sedlacek wrote:
>>>> >> > Thanks for this info,...
>>>> >> >
>>>> >> > How do I implement this tip?
>>>> >> >
>>>> >> > #18. Use the -server JVM option. This enables the server JVM, 
>>>> which
>>>> >> JIT
>>>> >> > compiles bytecode much earlier, and with stronger optimizations.
>>>> >> Startup
>>>> >> > and first calls will be slower due to JIT compilation taking more
>>>> >> time,
>>>> >> > but subsequent ones will be faster.
>>>> >> >
>>>> >> > Karel
>>>> >> >
>>>> >> > > In putting #1 into the JAVA_OPTS (which it appears that is the
>>>> >> > > CATALINA_OPTS
>>>> >> > > for our implementation), it doesn't appear to work, as Tomcat
>>>> >> doesn't
>>>> >> > > restart. It could be our version -- which is currently 5.0.30.
>>>> >> please
>>>> >> > > let
>>>> >> > > me know if there are other steps we need to take here as well.
>>>> >> > >
>>>> >> > > thanks,
>>>> >> > > Kim :-)
>>>> >> > >
>>>> >> > > On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
>>>> >> > >>
>>>> >> > >> I thought my latest blog post would be of interest to the 
>>>> people on
>>>> >> this
>>>> >> > >> list:
>>>> >> > >>
>>>> >> > >>
>>>> >> > >> 
>>>> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/ 
>>>>
>>>> >> > >>
>>
>> Karel Sedlacek                                          kvs1@cornell.edu
>> CIT Data Administration                                 Phn 607-255-7742
>> Cornell University                                              Fax 
>> 607-255-1297
>> Ithaca, NY 14853
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Ole Ersoy <ol...@gmail.com>.
Hi,

I'm trying to get the -server option working with jsvc.  When inserting -server I get this:

[root@ole init.d]# service tomcat start
Starting tomcat
27/08/2007 21:11:08 10371 jsvc error: Invalid option -server
27/08/2007 21:11:08 10371 jsvc error: Cannot parse command line arguments

The script looks like this (Note that if I remove "-server" tomcat start fine):

CATALINA_HOME=/usr/share/apache-tomcat
JAVA_HOME=/usr/lib/jvm/java
DAEMON_LAUNCHER=$CATALINA_HOME/bin/jsvc
TOMCAT_USER=tomcat
TMP_DIR=/var/cache/apache-tomcat/temp
CATALINA_OPTS=-server
CLASSPATH=$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/bin/commons-daemon.jar:$CATALINA_HOME/bin/bootstrap.jar

case "$1" in
  start)
    #
    # Start Tomcat
    #
    echo -n "Starting tomcat"
    echo
    $DAEMON_LAUNCHER -server \
    -user $TOMCAT_USER \
    -home $JAVA_HOME \
    -Dcatalina.home=$CATALINA_HOME \
    -Djava.io.tmpdir=$TMP_DIR \
    -outfile $CATALINA_HOME/logs/catalina.out \
    -errfile '&1' \
    -cp $CLASSPATH \
    org.apache.catalina.startup.Bootstrap
    #
    # To get a verbose JVM
    #-verbose     # To get a debug of jsvc.
    #-debug
    ;;

Any ideas?

Thanks,
- Ole




Karel Sedlacek wrote:
> OK, let me give this a whirl.
> 
> Karel
> 
> At 09:20 AM 8/22/2007, you wrote:
>> See the table in this page. On Windows on i586 java always defaults to 
>> client runtime. (amd64 or ia-64 are different)
>> http://java.sun.com/docs/hotspot/gc5.0/ergo5.html
>>
>> If you can set JAVA_OPTS=-server java starts with it. Print 
>> System.getProperties() and you can see what runtime is used.
>>
>> Ronald.
>>
>> On Wed Aug 22 14:15:27 CEST 2007 Tomcat Users List 
>> <us...@tomcat.apache.org> wrote:
>>> I am running a 4 core, 8GB, Server 2003 SP1 EE (not R2) machine.
>>> One JRE: 1.5.0_09
>>> Karel
>>> > as far as i know this option is outdated, hence the vm automatically
>>> > goes into server mode if it detects a server class machine (>=2GB RAM,
>>> > 2 processors (which also includes ht or dualcore)
>>> >
>>> > leon
>>> >
>>> > maybe wrong though
>>> >
>>> > On 8/22/07, Ben Souther <be...@souther.us> wrote:
>>> >> It depends on which operating system you're using and how you've
>>> >> installed Tomcat.
>>> >> Can you tell us which it is?
>>> >>
>>> >>
>>> >>
>>> >> On Wed, 2007-08-22 at 07:19, Karel V Sedlacek wrote:
>>> >> > Thanks for this info,...
>>> >> >
>>> >> > How do I implement this tip?
>>> >> >
>>> >> > #18. Use the -server JVM option. This enables the server JVM, which
>>> >> JIT
>>> >> > compiles bytecode much earlier, and with stronger optimizations.
>>> >> Startup
>>> >> > and first calls will be slower due to JIT compilation taking more
>>> >> time,
>>> >> > but subsequent ones will be faster.
>>> >> >
>>> >> > Karel
>>> >> >
>>> >> > > In putting #1 into the JAVA_OPTS (which it appears that is the
>>> >> > > CATALINA_OPTS
>>> >> > > for our implementation), it doesn't appear to work, as Tomcat
>>> >> doesn't
>>> >> > > restart. It could be our version -- which is currently 5.0.30.
>>> >> please
>>> >> > > let
>>> >> > > me know if there are other steps we need to take here as well.
>>> >> > >
>>> >> > > thanks,
>>> >> > > Kim :-)
>>> >> > >
>>> >> > > On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
>>> >> > >>
>>> >> > >> I thought my latest blog post would be of interest to the 
>>> people on
>>> >> this
>>> >> > >> list:
>>> >> > >>
>>> >> > >>
>>> >> > >> 
>>> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/ 
>>>
>>> >> > >>
> 
> Karel Sedlacek                                          kvs1@cornell.edu
> CIT Data Administration                                 Phn 607-255-7742
> Cornell University                                              Fax 
> 607-255-1297
> Ithaca, NY 14853
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Karel Sedlacek <kv...@cornell.edu>.
OK, let me give this a whirl.

Karel

At 09:20 AM 8/22/2007, you wrote:
>See the table in this page. On Windows on i586 java always defaults to 
>client runtime. (amd64 or ia-64 are different)
>http://java.sun.com/docs/hotspot/gc5.0/ergo5.html
>
>If you can set JAVA_OPTS=-server java starts with it. Print 
>System.getProperties() and you can see what runtime is used.
>
>Ronald.
>
>On Wed Aug 22 14:15:27 CEST 2007 Tomcat Users List 
><us...@tomcat.apache.org> wrote:
>>I am running a 4 core, 8GB, Server 2003 SP1 EE (not R2) machine.
>>One JRE: 1.5.0_09
>>Karel
>> > as far as i know this option is outdated, hence the vm automatically
>> > goes into server mode if it detects a server class machine (>=2GB RAM,
>> > 2 processors (which also includes ht or dualcore)
>> >
>> > leon
>> >
>> > maybe wrong though
>> >
>> > On 8/22/07, Ben Souther <be...@souther.us> wrote:
>> >> It depends on which operating system you're using and how you've
>> >> installed Tomcat.
>> >> Can you tell us which it is?
>> >>
>> >>
>> >>
>> >> On Wed, 2007-08-22 at 07:19, Karel V Sedlacek wrote:
>> >> > Thanks for this info,...
>> >> >
>> >> > How do I implement this tip?
>> >> >
>> >> > #18. Use the -server JVM option. This enables the server JVM, which
>> >> JIT
>> >> > compiles bytecode much earlier, and with stronger optimizations.
>> >> Startup
>> >> > and first calls will be slower due to JIT compilation taking more
>> >> time,
>> >> > but subsequent ones will be faster.
>> >> >
>> >> > Karel
>> >> >
>> >> > > In putting #1 into the JAVA_OPTS (which it appears that is the
>> >> > > CATALINA_OPTS
>> >> > > for our implementation), it doesn't appear to work, as Tomcat
>> >> doesn't
>> >> > > restart. It could be our version -- which is currently 5.0.30.
>> >> please
>> >> > > let
>> >> > > me know if there are other steps we need to take here as well.
>> >> > >
>> >> > > thanks,
>> >> > > Kim :-)
>> >> > >
>> >> > > On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
>> >> > >>
>> >> > >> I thought my latest blog post would be of interest to the people on
>> >> this
>> >> > >> list:
>> >> > >>
>> >> > >>
>> >> > >> 
>> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
>> >> > >>

Karel Sedlacek                                          kvs1@cornell.edu
CIT Data Administration                                 Phn 607-255-7742
Cornell University                                              Fax 
607-255-1297
Ithaca, NY 14853 



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Ronald Klop <ro...@base.nl>.
See the table in this page. On Windows on i586 java always defaults to client runtime. (amd64 or ia-64 are different)
http://java.sun.com/docs/hotspot/gc5.0/ergo5.html

If you can set JAVA_OPTS=-server java starts with it. Print System.getProperties() and you can see what runtime is used.

Ronald.

On Wed Aug 22 14:15:27 CEST 2007 Tomcat Users List <us...@tomcat.apache.org> wrote:
> I am running a 4 core, 8GB, Server 2003 SP1 EE (not R2) machine.
> One JRE: 1.5.0_09
> 
> Karel
> 
> > as far as i know this option is outdated, hence the vm automatically
> > goes into server mode if it detects a server class machine (>=2GB RAM,
> > 2 processors (which also includes ht or dualcore)
> >
> > leon
> >
> > maybe wrong though
> >
> > On 8/22/07, Ben Souther <be...@souther.us> wrote:
> >> It depends on which operating system you're using and how you've
> >> installed Tomcat.
> >> Can you tell us which it is?
> >>
> >>
> >>
> >> On Wed, 2007-08-22 at 07:19, Karel V Sedlacek wrote:
> >> > Thanks for this info,...
> >> >
> >> > How do I implement this tip?
> >> >
> >> > #18. Use the -server JVM option. This enables the server JVM, which
> >> JIT
> >> > compiles bytecode much earlier, and with stronger optimizations.
> >> Startup
> >> > and first calls will be slower due to JIT compilation taking more
> >> time,
> >> > but subsequent ones will be faster.
> >> >
> >> > Karel
> >> >
> >> > > In putting #1 into the JAVA_OPTS (which it appears that is the
> >> > > CATALINA_OPTS
> >> > > for our implementation), it doesn't appear to work, as Tomcat
> >> doesn't
> >> > > restart. It could be our version -- which is currently 5.0.30.
> >> please
> >> > > let
> >> > > me know if there are other steps we need to take here as well.
> >> > >
> >> > > thanks,
> >> > > Kim :-)
> >> > >
> >> > > On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
> >> > >>
> >> > >> I thought my latest blog post would be of interest to the people on
> >> this
> >> > >> list:
> >> > >>
> >> > >>
> >> > >> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
> >> > >>
> 

Re: [OT] 20 Tips for Using Tomcat in Production

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Karel,

Karel V Sedlacek wrote:
> I am running a 4 core, 8GB, Server 2003 SP1 EE (not R2) machine.
> One JRE: 1.5.0_09

Oh, it's a Windows machine. Are those ever called "servers"? ;)

(Just kidding.)

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGzETh9CaO5/Lv0PARAkAXAJ9YXVbnB+Q+epFof/Z1LC1eQ4nyVACfZp8H
oyLDlkQgpgyP/8SwZLdOh5g=
=H1v4
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Karel V Sedlacek <kv...@cornell.edu>.
I am running a 4 core, 8GB, Server 2003 SP1 EE (not R2) machine.
One JRE: 1.5.0_09

Karel

> as far as i know this option is outdated, hence the vm automatically
> goes into server mode if it detects a server class machine (>=2GB RAM,
> 2 processors (which also includes ht or dualcore)
>
> leon
>
> maybe wrong though
>
> On 8/22/07, Ben Souther <be...@souther.us> wrote:
>> It depends on which operating system you're using and how you've
>> installed Tomcat.
>> Can you tell us which it is?
>>
>>
>>
>> On Wed, 2007-08-22 at 07:19, Karel V Sedlacek wrote:
>> > Thanks for this info,...
>> >
>> > How do I implement this tip?
>> >
>> > #18. Use the -server JVM option. This enables the server JVM, which
>> JIT
>> > compiles bytecode much earlier, and with stronger optimizations.
>> Startup
>> > and first calls will be slower due to JIT compilation taking more
>> time,
>> > but subsequent ones will be faster.
>> >
>> > Karel
>> >
>> > > In putting #1 into the JAVA_OPTS (which it appears that is the
>> > > CATALINA_OPTS
>> > > for our implementation), it doesn't appear to work, as Tomcat
>> doesn't
>> > > restart.  It could be our version -- which is currently 5.0.30.
>> please
>> > > let
>> > > me know if there are other steps we need to take here as well.
>> > >
>> > > thanks,
>> > > Kim :-)
>> > >
>> > > On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
>> > >>
>> > >> I thought my latest blog post would be of interest to the people on
>> this
>> > >> list:
>> > >>
>> > >>
>> > >> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
>> > >>
>> > >> ---------------------------------------------------------------------
>> > >> To start a new topic, e-mail: users@tomcat.apache.org
>> > >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> > >> For additional commands, e-mail: users-help@tomcat.apache.org
>> > >>
>> > >>
>> > >
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To start a new topic, e-mail: users@tomcat.apache.org
>> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> > For additional commands, e-mail: users-help@tomcat.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Leon Rosenberg <ro...@googlemail.com>.
as far as i know this option is outdated, hence the vm automatically
goes into server mode if it detects a server class machine (>=2GB RAM,
2 processors (which also includes ht or dualcore)

leon

maybe wrong though

On 8/22/07, Ben Souther <be...@souther.us> wrote:
> It depends on which operating system you're using and how you've
> installed Tomcat.
> Can you tell us which it is?
>
>
>
> On Wed, 2007-08-22 at 07:19, Karel V Sedlacek wrote:
> > Thanks for this info,...
> >
> > How do I implement this tip?
> >
> > #18. Use the -server JVM option. This enables the server JVM, which JIT
> > compiles bytecode much earlier, and with stronger optimizations. Startup
> > and first calls will be slower due to JIT compilation taking more time,
> > but subsequent ones will be faster.
> >
> > Karel
> >
> > > In putting #1 into the JAVA_OPTS (which it appears that is the
> > > CATALINA_OPTS
> > > for our implementation), it doesn't appear to work, as Tomcat doesn't
> > > restart.  It could be our version -- which is currently 5.0.30.  please
> > > let
> > > me know if there are other steps we need to take here as well.
> > >
> > > thanks,
> > > Kim :-)
> > >
> > > On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
> > >>
> > >> I thought my latest blog post would be of interest to the people on this
> > >> list:
> > >>
> > >>
> > >> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
> > >>
> > >> ---------------------------------------------------------------------
> > >> To start a new topic, e-mail: users@tomcat.apache.org
> > >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > >> For additional commands, e-mail: users-help@tomcat.apache.org
> > >>
> > >>
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Ben Souther <be...@souther.us>.
It depends on which operating system you're using and how you've
installed Tomcat.
Can you tell us which it is?



On Wed, 2007-08-22 at 07:19, Karel V Sedlacek wrote:
> Thanks for this info,...
> 
> How do I implement this tip?
> 
> #18. Use the -server JVM option. This enables the server JVM, which JIT
> compiles bytecode much earlier, and with stronger optimizations. Startup
> and first calls will be slower due to JIT compilation taking more time,
> but subsequent ones will be faster.
> 
> Karel
> 
> > In putting #1 into the JAVA_OPTS (which it appears that is the
> > CATALINA_OPTS
> > for our implementation), it doesn't appear to work, as Tomcat doesn't
> > restart.  It could be our version -- which is currently 5.0.30.  please
> > let
> > me know if there are other steps we need to take here as well.
> >
> > thanks,
> > Kim :-)
> >
> > On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
> >>
> >> I thought my latest blog post would be of interest to the people on this
> >> list:
> >>
> >>
> >> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
> >>
> >> ---------------------------------------------------------------------
> >> To start a new topic, e-mail: users@tomcat.apache.org
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Karel V Sedlacek <kv...@cornell.edu>.
Thanks for this info,...

How do I implement this tip?

#18. Use the -server JVM option. This enables the server JVM, which JIT
compiles bytecode much earlier, and with stronger optimizations. Startup
and first calls will be slower due to JIT compilation taking more time,
but subsequent ones will be faster.

Karel

> In putting #1 into the JAVA_OPTS (which it appears that is the
> CATALINA_OPTS
> for our implementation), it doesn't appear to work, as Tomcat doesn't
> restart.  It could be our version -- which is currently 5.0.30.  please
> let
> me know if there are other steps we need to take here as well.
>
> thanks,
> Kim :-)
>
> On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
>>
>> I thought my latest blog post would be of interest to the people on this
>> list:
>>
>>
>> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Kim Albee <mt...@gmail.com>.
In putting #1 into the JAVA_OPTS (which it appears that is the CATALINA_OPTS
for our implementation), it doesn't appear to work, as Tomcat doesn't
restart.  It could be our version -- which is currently 5.0.30.  please let
me know if there are other steps we need to take here as well.

thanks,
Kim :-)

On 8/21/07, Shane Witbeck <sh...@digitalsanctum.com> wrote:
>
> I thought my latest blog post would be of interest to the people on this
> list:
>
>
> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: 20 Tips for Using Tomcat in Production

Posted by David Smith <dn...@cornell.edu>.
Well... be careful on the use of the shared/common classloader.  It 
works as long as all the apps can use the same version of a library.  If 
there are changes to the API and you have the library in the shared or 
common classloaders you'll have to upgrade all the webapps at once.

--David

David Delbecq wrote:

>Very nice. May i suggest 2 comments perhaps?:
>
>6... If you're loading several applications with several of the same
>library dependencies, consider moving them from the applications'
>|WEB-INF/lib| directory to Tomcat's shared library
>|{catalina.home}/shared/lib|. This will reduce the memory used by each
>application and result in smaller WAR files.
>
>You should make a remark that this change the behaviour of webapp:
> a) Shared classloader is searched in last ressort when looking for
>classes, according to
>http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.
> b) Because the classes are shared, they share config & singletons and
>if they store objects statically they will prevent webapp unloading
>
>
>7...Consider JDK 1.5 or even better JDK 1.6 to take advantage of
>performance improvements.
>
>Note that you can gain even more performance if you recompile your
>"string concatenation hungry" (d="aaaa"+b+"ccc") support libaries for
>jdk 5+ on a multi CPU system. This is because jdk5 uses the
>non-synchronized stringbuilder instead of the jdk 4- synchronized
>StringBuffer. And synchronization over multiple cpu takes a few more
>cycles than on single CPU machines.
>
>
>
>En l'instant précis du 21/08/07 14:10, Shane Witbeck s'exprimait en ces
>termes:
>  
>
>>I thought my latest blog post would be of interest to the people on this list:
>>
>>http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
>>
>>---------------------------------------------------------------------
>>To start a new topic, e-mail: users@tomcat.apache.org
>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>For additional commands, e-mail: users-help@tomcat.apache.org
>>  
>>    
>>
>
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Shane Witbeck <sh...@digitalsanctum.com>.
Thanks! I've corrected the entries.

On 8/21/07, Ben Souther <be...@souther.us> wrote:
> The connector entries are also case sensitive:
>
> <connector port="8009" ...
>
> Should be
>
> <Connector port="8009" ...
>
>
>
>
> On Tue, 2007-08-21 at 13:55, Shane Witbeck wrote:
> > Good point. I've updated the entry to be more specific. Thanks!
> >
> > On 8/21/07, Ben Souther <be...@souther.us> wrote:
> > > Tip #8:
> > >
> > > You tell the users about the tomcat-users.xml file for adding the role
> > > info but never tell them where to enter the RemoteAddrValve in order to
> > > restrict IPs.
> > >
> > >
> > >
> > >
> > >
> > > On Tue, 2007-08-21 at 10:57, Shane Witbeck wrote:
> > > > David,
> > > >
> > > > Thanks for your comments. I've added them to the blog post for
> > > > everyone's benefit.
> > > >
> > > > Shane
> > > >
> > > > On 8/21/07, David Delbecq <de...@oma.be> wrote:
> > > > > Very nice. May i suggest 2 comments perhaps?:
> > > > >
> > > > > 6... If you're loading several applications with several of the same
> > > > > library dependencies, consider moving them from the applications'
> > > > > |WEB-INF/lib| directory to Tomcat's shared library
> > > > > |{catalina.home}/shared/lib|. This will reduce the memory used by each
> > > > > application and result in smaller WAR files.
> > > > >
> > > > > You should make a remark that this change the behaviour of webapp:
> > > > >  a) Shared classloader is searched in last ressort when looking for
> > > > > classes, according to
> > > > > http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.
> > > > >  b) Because the classes are shared, they share config & singletons and
> > > > > if they store objects statically they will prevent webapp unloading
> > > > >
> > > > >
> > > > > 7...Consider JDK 1.5 or even better JDK 1.6 to take advantage of
> > > > > performance improvements.
> > > > >
> > > > > Note that you can gain even more performance if you recompile your
> > > > > "string concatenation hungry" (d="aaaa"+b+"ccc") support libaries for
> > > > > jdk 5+ on a multi CPU system. This is because jdk5 uses the
> > > > > non-synchronized stringbuilder instead of the jdk 4- synchronized
> > > > > StringBuffer. And synchronization over multiple cpu takes a few more
> > > > > cycles than on single CPU machines.
> > > > >
> > > > >
> > > > >
> > > > > En l'instant précis du 21/08/07 14:10, Shane Witbeck s'exprimait en ces
> > > > > termes:
> > > > > > I thought my latest blog post would be of interest to the people on this list:
> > > > > >
> > > > > > http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
> > > > > >
> > > > > > ---------------------------------------------------------------------
> > > > > > To start a new topic, e-mail: users@tomcat.apache.org
> > > > > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > > > > For additional commands, e-mail: users-help@tomcat.apache.org
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > http://www.noooxml.org/
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To start a new topic, e-mail: users@tomcat.apache.org
> > > > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > > > For additional commands, e-mail: users-help@tomcat.apache.org
> > > > >
> > > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To start a new topic, e-mail: users@tomcat.apache.org
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Thank you,

Shane Witbeck
Digital Sanctum, inc.
-----------------------------------------------------
skype: digitalsanctum
  blog: http://www.digitalsanctum.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Ben Souther <be...@souther.us>.
The connector entries are also case sensitive:

<connector port="8009" ...

Should be 

<Connector port="8009" ...




On Tue, 2007-08-21 at 13:55, Shane Witbeck wrote:
> Good point. I've updated the entry to be more specific. Thanks!
> 
> On 8/21/07, Ben Souther <be...@souther.us> wrote:
> > Tip #8:
> >
> > You tell the users about the tomcat-users.xml file for adding the role
> > info but never tell them where to enter the RemoteAddrValve in order to
> > restrict IPs.
> >
> >
> >
> >
> >
> > On Tue, 2007-08-21 at 10:57, Shane Witbeck wrote:
> > > David,
> > >
> > > Thanks for your comments. I've added them to the blog post for
> > > everyone's benefit.
> > >
> > > Shane
> > >
> > > On 8/21/07, David Delbecq <de...@oma.be> wrote:
> > > > Very nice. May i suggest 2 comments perhaps?:
> > > >
> > > > 6... If you're loading several applications with several of the same
> > > > library dependencies, consider moving them from the applications'
> > > > |WEB-INF/lib| directory to Tomcat's shared library
> > > > |{catalina.home}/shared/lib|. This will reduce the memory used by each
> > > > application and result in smaller WAR files.
> > > >
> > > > You should make a remark that this change the behaviour of webapp:
> > > >  a) Shared classloader is searched in last ressort when looking for
> > > > classes, according to
> > > > http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.
> > > >  b) Because the classes are shared, they share config & singletons and
> > > > if they store objects statically they will prevent webapp unloading
> > > >
> > > >
> > > > 7...Consider JDK 1.5 or even better JDK 1.6 to take advantage of
> > > > performance improvements.
> > > >
> > > > Note that you can gain even more performance if you recompile your
> > > > "string concatenation hungry" (d="aaaa"+b+"ccc") support libaries for
> > > > jdk 5+ on a multi CPU system. This is because jdk5 uses the
> > > > non-synchronized stringbuilder instead of the jdk 4- synchronized
> > > > StringBuffer. And synchronization over multiple cpu takes a few more
> > > > cycles than on single CPU machines.
> > > >
> > > >
> > > >
> > > > En l'instant précis du 21/08/07 14:10, Shane Witbeck s'exprimait en ces
> > > > termes:
> > > > > I thought my latest blog post would be of interest to the people on this list:
> > > > >
> > > > > http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To start a new topic, e-mail: users@tomcat.apache.org
> > > > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > > > For additional commands, e-mail: users-help@tomcat.apache.org
> > > > >
> > > >
> > > >
> > > > --
> > > > http://www.noooxml.org/
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To start a new topic, e-mail: users@tomcat.apache.org
> > > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > > For additional commands, e-mail: users-help@tomcat.apache.org
> > > >
> > > >
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Shane Witbeck <sh...@digitalsanctum.com>.
Good point. I've updated the entry to be more specific. Thanks!

On 8/21/07, Ben Souther <be...@souther.us> wrote:
> Tip #8:
>
> You tell the users about the tomcat-users.xml file for adding the role
> info but never tell them where to enter the RemoteAddrValve in order to
> restrict IPs.
>
>
>
>
>
> On Tue, 2007-08-21 at 10:57, Shane Witbeck wrote:
> > David,
> >
> > Thanks for your comments. I've added them to the blog post for
> > everyone's benefit.
> >
> > Shane
> >
> > On 8/21/07, David Delbecq <de...@oma.be> wrote:
> > > Very nice. May i suggest 2 comments perhaps?:
> > >
> > > 6... If you're loading several applications with several of the same
> > > library dependencies, consider moving them from the applications'
> > > |WEB-INF/lib| directory to Tomcat's shared library
> > > |{catalina.home}/shared/lib|. This will reduce the memory used by each
> > > application and result in smaller WAR files.
> > >
> > > You should make a remark that this change the behaviour of webapp:
> > >  a) Shared classloader is searched in last ressort when looking for
> > > classes, according to
> > > http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.
> > >  b) Because the classes are shared, they share config & singletons and
> > > if they store objects statically they will prevent webapp unloading
> > >
> > >
> > > 7...Consider JDK 1.5 or even better JDK 1.6 to take advantage of
> > > performance improvements.
> > >
> > > Note that you can gain even more performance if you recompile your
> > > "string concatenation hungry" (d="aaaa"+b+"ccc") support libaries for
> > > jdk 5+ on a multi CPU system. This is because jdk5 uses the
> > > non-synchronized stringbuilder instead of the jdk 4- synchronized
> > > StringBuffer. And synchronization over multiple cpu takes a few more
> > > cycles than on single CPU machines.
> > >
> > >
> > >
> > > En l'instant précis du 21/08/07 14:10, Shane Witbeck s'exprimait en ces
> > > termes:
> > > > I thought my latest blog post would be of interest to the people on this list:
> > > >
> > > > http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To start a new topic, e-mail: users@tomcat.apache.org
> > > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > > For additional commands, e-mail: users-help@tomcat.apache.org
> > > >
> > >
> > >
> > > --
> > > http://www.noooxml.org/
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To start a new topic, e-mail: users@tomcat.apache.org
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Thank you,

Shane Witbeck
Digital Sanctum, inc.
-----------------------------------------------------
skype: digitalsanctum
  blog: http://www.digitalsanctum.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Ben Souther <be...@souther.us>.
Tip #8:

You tell the users about the tomcat-users.xml file for adding the role
info but never tell them where to enter the RemoteAddrValve in order to
restrict IPs.





On Tue, 2007-08-21 at 10:57, Shane Witbeck wrote:
> David,
> 
> Thanks for your comments. I've added them to the blog post for
> everyone's benefit.
> 
> Shane
> 
> On 8/21/07, David Delbecq <de...@oma.be> wrote:
> > Very nice. May i suggest 2 comments perhaps?:
> >
> > 6... If you're loading several applications with several of the same
> > library dependencies, consider moving them from the applications'
> > |WEB-INF/lib| directory to Tomcat's shared library
> > |{catalina.home}/shared/lib|. This will reduce the memory used by each
> > application and result in smaller WAR files.
> >
> > You should make a remark that this change the behaviour of webapp:
> >  a) Shared classloader is searched in last ressort when looking for
> > classes, according to
> > http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.
> >  b) Because the classes are shared, they share config & singletons and
> > if they store objects statically they will prevent webapp unloading
> >
> >
> > 7...Consider JDK 1.5 or even better JDK 1.6 to take advantage of
> > performance improvements.
> >
> > Note that you can gain even more performance if you recompile your
> > "string concatenation hungry" (d="aaaa"+b+"ccc") support libaries for
> > jdk 5+ on a multi CPU system. This is because jdk5 uses the
> > non-synchronized stringbuilder instead of the jdk 4- synchronized
> > StringBuffer. And synchronization over multiple cpu takes a few more
> > cycles than on single CPU machines.
> >
> >
> >
> > En l'instant précis du 21/08/07 14:10, Shane Witbeck s'exprimait en ces
> > termes:
> > > I thought my latest blog post would be of interest to the people on this list:
> > >
> > > http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
> > >
> > > ---------------------------------------------------------------------
> > > To start a new topic, e-mail: users@tomcat.apache.org
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> >
> >
> > --
> > http://www.noooxml.org/
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Shane Witbeck <sh...@digitalsanctum.com>.
David,

Thanks for your comments. I've added them to the blog post for
everyone's benefit.

Shane

On 8/21/07, David Delbecq <de...@oma.be> wrote:
> Very nice. May i suggest 2 comments perhaps?:
>
> 6... If you're loading several applications with several of the same
> library dependencies, consider moving them from the applications'
> |WEB-INF/lib| directory to Tomcat's shared library
> |{catalina.home}/shared/lib|. This will reduce the memory used by each
> application and result in smaller WAR files.
>
> You should make a remark that this change the behaviour of webapp:
>  a) Shared classloader is searched in last ressort when looking for
> classes, according to
> http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.
>  b) Because the classes are shared, they share config & singletons and
> if they store objects statically they will prevent webapp unloading
>
>
> 7...Consider JDK 1.5 or even better JDK 1.6 to take advantage of
> performance improvements.
>
> Note that you can gain even more performance if you recompile your
> "string concatenation hungry" (d="aaaa"+b+"ccc") support libaries for
> jdk 5+ on a multi CPU system. This is because jdk5 uses the
> non-synchronized stringbuilder instead of the jdk 4- synchronized
> StringBuffer. And synchronization over multiple cpu takes a few more
> cycles than on single CPU machines.
>
>
>
> En l'instant précis du 21/08/07 14:10, Shane Witbeck s'exprimait en ces
> termes:
> > I thought my latest blog post would be of interest to the people on this list:
> >
> > http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
> --
> http://www.noooxml.org/
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Thank you,

Shane Witbeck
Digital Sanctum, inc.
-----------------------------------------------------
skype: digitalsanctum
  blog: http://www.digitalsanctum.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by David Delbecq <de...@oma.be>.
Very nice. May i suggest 2 comments perhaps?:

6... If you're loading several applications with several of the same
library dependencies, consider moving them from the applications'
|WEB-INF/lib| directory to Tomcat's shared library
|{catalina.home}/shared/lib|. This will reduce the memory used by each
application and result in smaller WAR files.

You should make a remark that this change the behaviour of webapp:
 a) Shared classloader is searched in last ressort when looking for
classes, according to
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.
 b) Because the classes are shared, they share config & singletons and
if they store objects statically they will prevent webapp unloading


7...Consider JDK 1.5 or even better JDK 1.6 to take advantage of
performance improvements.

Note that you can gain even more performance if you recompile your
"string concatenation hungry" (d="aaaa"+b+"ccc") support libaries for
jdk 5+ on a multi CPU system. This is because jdk5 uses the
non-synchronized stringbuilder instead of the jdk 4- synchronized
StringBuffer. And synchronization over multiple cpu takes a few more
cycles than on single CPU machines.



En l'instant précis du 21/08/07 14:10, Shane Witbeck s'exprimait en ces
termes:
> I thought my latest blog post would be of interest to the people on this list:
>
> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>   


-- 
http://www.noooxml.org/


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 20 Tips for Using Tomcat in Production

Posted by Tim Funk <fu...@joedog.org>.
#6 - Shared classloaders are evil, but not as evil as the invoker 
servlet. With a  shared loader you can easily get Singleton assumptions 
being wrong, class cast exceptions, versioning woes, and other issues. 
Saving a little perm memory just doesn't justify it.

#7 - You should have a staging environment just like production. Your 
development environment can just be a laptop which will probably 
somewhat underpowered compared to your production instance.



-Tim

Shane Witbeck wrote:
> I thought my latest blog post would be of interest to the people on this list:
> 
> http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org