• 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

Tomcat spawns many new processes

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to state off the top that I didnt develop the application. I have been slowly bringing the server and application up to some respecitablity. I have upgraded the Java to 1.4.2 (it was at 1.3.2) and added Apache/Mod_jk2 and upgraded to Tomcat 5. What I am about to describe has been happening since I took the project over. I start the application and there are 41 processes that are present when I do a ps -aef, later on there are 15 more, a little later there are 10, for a total of 66. This grows and I cant tell if it shrinks. There is also a watcher application that starts and restarts Tomcat processes if it can not connect to the application.

Okay enough of that. I have a test server I setup myself, and have done all the same stuff on, Apache/Tomcat/Mod_jk. However when I start up there is one one process that starts. When I hit it with some load, it stays the same, one process.

Also in JAVA_OPTS i have seen many people referring to -server, I have set the JAVA_OPTS to headless.

Any help, or pointers about TOmcat and servers would be appreciated.
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On Linux, especially the older 2.4 based kernels, threads == processes. Therefore, whenever Tomcat spawns a new thread your 'ps' will show a new process. As with all servlet containers it is up to Tomcat when to reap those threads. It may not - and that is why you see that the number of processes is growing.

Unless you're getting several hundred I wouldn't be concerned about it.
 
Steven Lister
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay thats what I thought. The way I was thinking of handling this, is something that I have done on other sites that are older and had some problems with clearing out and that is to restart the application occasionally, 2-3 times a week.

Think that would be a good idea.
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic