• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Check Used Wars on Tomcat 7

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
since on our production we have multiple Wars deployed, the performance of the overall website result being very slow and on random restarts,
is there any way to check which ones are the WARs used, so we can undeploy the other unused WARs to gain some performance?
Thanks you.
 
Saloon Keeper
Posts: 10428
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How much WARs do you have deployed, and how did you figure out that that is the source of your performance issues?
 
Sei ton
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:How much WARs do you have deployed, and how did you figure out that that is the source of your performance issues?



Hello Stephan,
we have 70 Wars deployed, and we're sure that most of them are not being used at all, i just need to clean up the unused Wars, so i can make a better analysis,
we figured out that the performance is superfast to everything at the start up, the website responds great (the login process takes 10-15 second or so), but after 5 min or so just to login takes 2 minutes or so.
 
Bartender
Posts: 20938
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a WAR is deployed in Tomcat, it is "used". What you really need to know is how many webapps are being used. A webapp is not the same thing as a WAR, since you can use the same WAR for multiple instances of a webapp. You might do that, for example, if you are running a multi-client webserver and you want to keep the clients' usage of the webapps totally isolated.

It's fairly easy to track what webapps are being used. Every webapp is deployed with a context path, and by activating the Tomcat request logging Valve, you can see the URLs as they come in and examine the logs for context paths. If a WAR is not being used, the context path(s) it was deployed under will see no URL requests.

This isn't foolproof. Some apps might only be used at month- or year- end. Some might be used even more infrequently. So the best approach would be to setup a secondary server, move the unreferenced webapps over there and leave the primary server for the active stuff.

You might also want to measure some stats on those apps and do some load balancing while you're at it. There's no law that says a single instance of a Tomcat server has to contain everything. You can balance by app and/or balance by Tomcat cluster.
 
Sei ton
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:
It's fairly easy to track what webapps are being used. Every webapp is deployed with a context path, and by activating the Tomcat request logging Valve, you can see the URLs as they come in and examine the logs for context paths. If a WAR is not being used, the context path(s) it was deployed under will see no URL requests.
.



Hello Tim,
you talking about this configuration?


So on the log file i should get any request if used that is referred to the name of the War/Webapp deployed?

Thank you.

 
Tim Holloway
Bartender
Posts: 20938
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sei ton wrote:
So on the log file i should get any request if used that is referred to the name of the War/Webapp deployed?



No, I don't think so. I believe that this Valve is invoked before the URL gets sent to a webapp, so the WAR isn't directly known yet.

But since the context path part of the URL does determine which WAR will ultimately be used, you can record the incoming URL context paths and use them to determine what WARs are being invoked.

You can determine what context path has been assigned to which WAR(s) by looking at how the WARs were deployed into Tomcat. This can be done by manual inspection, but with that many WARs, I'd use one of the Tomcat management interfaces to automate the process of generating the context-to-WAR map.
 
Sei ton
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:
You can determine what context path has been assigned to which WAR(s) by looking at how the WARs were deployed into Tomcat. This can be done by manual inspection, but with that many WARs, I'd use one of the Tomcat management interfaces to automate the process of generating the context-to-WAR map.



Any clue or link on how do i do this?
Thank you.
 
Tim Holloway
Bartender
Posts: 20938
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the Tomcat instructions. There's a management webapp, that's installed by default in many Tomcat distros. There are management web services. There's MBeans, I believe. And several other APIs, depending on which version and configuration of Tomcat you're using.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!