Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Sep 17, 2005 8:25 am 
Offline
Senior Member
User avatar

Joined: Tue Aug 17, 2004 11:37 pm
Posts: 262
Website: http://www.our-lan.com
WLM: nf@our-lan.com
Location: Brisbane, Australia
Ok, well heres the nice stuff
i have apache 2 working nicely now
i have tomcat5.5 working
i have the modjk connector compiled and working
i have in my apache2 virtualhost set up and telling stuff to juse JkMount.

i was hoping for a way to make apache2 automaticly configure tomcat, ie so that i dont have to write a server.xml

or soemthing like that, or a way that the server.xml is auto generated based on the apachevhosts or some sort of configuration?

suggestions on how to do it?

cheers
NF


Top
   
 Post subject:
PostPosted: Tue Sep 20, 2005 6:40 am 
Offline
Senior Member

Joined: Sat Dec 13, 2003 12:39 pm
Posts: 98
With older tomcat versions you could have it generate apache config files automatically from server.xml. Try googling tomcat, apache-config, apacheconfig. I never used it, but I know used to be there, and it may still be in 5.5. You'd enable the option, tomcat generates an apache config file when it starts, and apache would need to include that file from its main config.

As far as apache generating the tomcat config, I think you'd need to write some scripts, unfortunately. The web app model is really geared toward web apps driving other config stuff. For example you couldn't back out data source settings from an apache config. Maybe there's something out there that will generate server.xml for a fixed web app model, but I haven't seen anything.


Top
   
 Post subject:
PostPosted: Tue Sep 20, 2005 9:11 am 
Offline
Senior Member
User avatar

Joined: Tue Aug 17, 2004 11:37 pm
Posts: 262
Website: http://www.our-lan.com
WLM: nf@our-lan.com
Location: Brisbane, Australia
yeah i came to that conclusion unfortunatly, thats kewl, i dont really need it to generate files, i was just hoping for the best but expecting the worst :D

tho knowing how the hell to make it limit its theads would be nice.. even tho my server .xml file looks like this
Code:
<Server port="8005" shutdown="SHUTDOWN">
<!--
<Listener className="org.apache.jk.config.ApacheConfig" modJk="/usr/lib/apache2/modules/mod_jk.so" workersConfig="/etc/apache2/workers.properties"/>
  -->
  <Service name="Catalina">
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" enableLookups="false" maxThreads="1" maxSpareThreads="1" minSpareThreads="1" redirectPort="8443" protocol="AJP/1.3" />

    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="our-lan.com">
      <Host name="our-lan.com" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
        <Context path="" docBase="/home/hosting/our-lan.com/www" debug="0"/>
      </Host>     
      <Host name="themetacity.com">
         <Alias>www.themetacity.com</Alias>
         <Context path="" docBase="/home/hosting/themetacity.com/www" debug="0" />
      </Host>

    </Engine>

  </Service>

</Server>

ps aux shows that i still have a crapload running :S
Code:
nf@broken:~$ ps aux | grep jav     
tomcat    2016  0.0 33.0 286140 30120 ?        S    17:53   0:01 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2017  0.0 33.0 286140 30120 ?        S    17:53   0:00 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2018  0.0 33.0 286140 30120 ?        S    17:53   0:00 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2019  0.0 33.0 286140 30120 ?        S    17:53   0:00 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2020  0.0 33.0 286140 30120 ?        S    17:53   0:00 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2021  0.0 33.0 286140 30120 ?        S    17:53   0:00 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2022  0.0 33.0 286140 30120 ?        S    17:53   0:00 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2023  0.0 33.0 286140 30120 ?        S    17:53   0:00 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2024  0.0 33.0 286140 30120 ?        S    17:53   0:00 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2025  0.0 33.0 286140 30120 ?        S    17:53   0:02 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2026  0.0 33.0 286140 30120 ?        S    17:53   0:00 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL
tomcat    2027  0.0 33.0 286140 30120 ?        S    17:53   0:00 /usr/lib/j2sdk1.5-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderL

nf        6673  0.0  0.4   1516   452 pts/1    R+   23:08   0:00 grep jav
nf@broken:~$


any suggestions for limiting the ammount of threads created?


Top
   
 Post subject:
PostPosted: Wed Sep 21, 2005 2:30 am 
Offline
Senior Member

Joined: Sat Dec 13, 2003 12:39 pm
Posts: 98
You should confirm that it is indeed creating too may threads. You can do this by checking the tomcat status page if you have it enabled. The status page will show the thread settings and how many are actually in use.

Also try "kill -3 [pid]" and java will dump current thread stats to stdout.

Your extra ps proccesses are probably some of the "normal" threads, like the tomcat shutdown hook. You can check you don't have a connector listening on :8080, no RMI/JMX stuff listening, etc. "netstat -n -l -p" might help figure which other ports java is listening on. Each port java listens on probably has at least one thread associated with it.

If you have a java IDE with a debugger, you could also just run Tomcat on your local machine in the debugger, with the same settings, and examine the threads by hand. That's what I'd do.


Top
   
 Post subject:
PostPosted: Wed Sep 21, 2005 4:01 am 
Offline
Senior Member
User avatar

Joined: Tue Aug 17, 2004 11:37 pm
Posts: 262
Website: http://www.our-lan.com
WLM: nf@our-lan.com
Location: Brisbane, Australia
kill -3 on any of the pids output'd nothing

only listening is 8005 and 8009.. the shutdown and the ajp connector ports

i cant imagine how about 9 proccess are shown even with assuming ecah 8005,8009 + processing threasd.. creates to 9.. theres njust not logical reason


Top
   
 Post subject:
PostPosted: Wed Sep 21, 2005 6:51 am 
Offline
Senior Member

Joined: Sat Dec 13, 2003 12:39 pm
Posts: 98
kill -3 will cause java to output to its stdout, probably a tomcat log file, depending how you have it set up.

Did you check the tomcat status page?

I'm not at all surprised to see it create 9 threads. Just starting plain old java with a hello world type of program will cause java to create several threads, if you watch in a debugger. You may be able to trim down though if you find out exactly which tomcat features are using threads.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group