• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

improving tomcat performance

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi.
I am using tomcat 4.1 on windows 2000 Server 2GB RAM.
before I used Netscape enterprise Server 3.6 on Digital Unix 4.0D 256 RAM.
I use some applications, but is more slow with tomcat.
by example:
A summary monthly html report, before take 3 or 5 seconds. But now in tomcat take 25 seconds.
I change my jsp code top use connection pool but there is no change.
How can I configure tomcat to assign more resources to improve the performance.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It hurts to say this about NES (any version)...

But NES is *enterprise* software, and Tomcat is merely a reference implementation, and while fast enough for most things... I doubt its designers had enterprise reporting in mind.

There is no "go faster" tweak in any of Tomcat's configuration files.

That being said... are all other things equal? The db connection pool (is it the same as before)
the database (same or different?)
network connections (was the previous server in your datacenter and tomcat is on your desktop?)
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Putting Tomcat back on a unix system will help. I am not bashing Windows but I have notices performance differences between putting Tomcat on Windows vs Unix/Linux. That would be my advice.
But I agree with the above post. I would consider Tomcat more of a nice development Container. But it is free and it does work really well. So I am not complaining about that either. Just my thoughts.
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pedro,
There are two things that I can think off the top of my head that you could do to increase performance. One is running tomcat with the server option. To do this go to the bin directory under TOMCAT_HOME and edit the three lines at the bottom
set _RUNJAVA="%JAVA_HOME%\bin\java"
set _RUNJAVAW="%JAVA_HOME%\bin\javaw"
set _RUNJDB="%JAVA_HOME%\bin\jdb"
TO
set _RUNJAVA="%JAVA_HOME%\bin\java" -server
set _RUNJAVAW="%JAVA_HOME%\bin\javaw" -server
set _RUNJDB="%JAVA_HOME%\bin\jdb" -server
This will increase its efficiency and thus perform better.
You can also adjust the maximum size of the JVM's heap size which can also increase performance. The default JVM heap size is set to 64. I believe you can adjust it to say 256Mb, but this number must be a multiple of 1024.
This is done using the JVM's parameter -X
(java -Xms256m -Xmx256m)
where Xms is the min heap size and Xmx is the max heap size. You may also specifiy GBs by substituting the last m for a g.
Just remember a size that is to ridiculous will not help when it comes time to do garbage collection.
Hope this helps you.
Let me know if you have any other questions.
Ryan
 
Pedro Garcia
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to everyone for its comments.
I undestand that I don't hope the same performance in a free software to one commercial.
But on the other hand Ryan thanks for the tips that you post.
Only a question.
Where I can adjust the maximum size for JVM?
Where this must be configure?
Thanks again..
 
Ryan Bailey
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pedro,
Correct me if I'm wrong, but I believe those are parameters that can be passed into the JVM when its started.
simply java -x***
Hope this helps
 
Pedro Garcia
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are rigth...
But, the problem is that I have tomcat as window service, and I don't know where do I put -Xmx256m
 
Ryan Bailey
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

But, the problem is that I have tomcat as window service, and I don't know where do I put -Xmx256m


Pedro,
I'm sorry, You want to include the -Xmx256m within the setclasspath.bat file under TOMCAT_HOME/bin directory. It is the fourth line from the bottom that you want to modify (set _RUNJAVA="%JAVA_HOME%\bin\java"). Just put that at the end like you did with -server.
Just to let you know the -server option enables you to utilize the server's Just In Time compiler. The cost of using this is the time it takes the server to startup, Whoopie Do .
Hope this helps,
Ryan
 
reply
    Bookmark Topic Watch Topic
  • New Topic