take 2: apache 2, tomcat 5.5
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
5 Replies
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.
tho knowing how the hell to make it limit its theads would be nice.. even tho my server .xml file looks like this
<server port="8005" shutdown="SHUTDOWN"><service name="Catalina"><connector port="8009" enablelookups="false" maxthreads="1" maxsparethreads="1" minsparethreads="1" redirectport="8443" protocol="AJP/1.3"><engine name="Catalina" defaulthost="our-lan.com"><host name="themetacity.com"><alias>www.themetacity.com</alias></host></engine></connector></service></server>
ps aux shows that i still have a crapload running :S
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?
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.
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
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.