You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gu...@tieto.com on 2009/02/19 13:27:26 UTC

When will tomcat 5.5.25 spawn a new process

Hi,
When will Tomcat 5.5.25 spawn a new process on a Solaris 10 server?
I mean a normal process and not a light weight process.

Thanks
/Gunnar

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: SV: SV: SV: When will tomcat 5.5.25 spawn a new process

Posted by Mark Thomas <ma...@apache.org>.
Gunnar.Bostrom@tieto.com wrote:
> Hi,
> I think there is some problem (rarely) when calling CGI.

Try using the CGIServlet from trunk. It should work on 5.5.x and I think
there have been a number of fixes since 5.5.25. You do a diff to be sure.

Mark

> For each "daemon" tomcat process I can see 2 threads like this:
> 
> "Thread-68" daemon prio=10 tid=0x003ee348 nid=0xac runnable [0xacb7f000..0xacb7fa70]
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(Unknown Source)
> 	at java.lang.UNIXProcess$DeferredCloseInputStream.read(Unknown Source)
> 	at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
> 	at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
> 	at sun.nio.cs.StreamDecoder.read(Unknown Source)
> 	- locked <0xb9d46378> (a java.io.InputStreamReader)
> 	at java.io.InputStreamReader.read(Unknown Source)
> 	at java.io.BufferedReader.fill(Unknown Source)
> 	at java.io.BufferedReader.readLine(Unknown Source)
> 	- locked <0xb9d46378> (a java.io.InputStreamReader)
> 	at java.io.BufferedReader.readLine(Unknown Source)
> 	at org.apache.catalina.servlets.CGIServlet$CGIRunner.sendToLog(CGIServlet.java:1860)
> 	at org.apache.catalina.servlets.CGIServlet$CGIRunner.access$400(CGIServlet.java:1435)
> 	at org.apache.catalina.servlets.CGIServlet$1.run(CGIServlet.java:1709)
> 
> "process reaper" daemon prio=10 tid=0x003ee040 nid=0xab runnable [0xad97f000..0xad97f8f0]
> 	at java.lang.UNIXProcess.waitForProcessExit(Native Method)
> 	at java.lang.UNIXProcess.access$900(Unknown Source)
> 	at java.lang.UNIXProcess$2$1.run(Unknown Source)
> 
> 
> It seems to hang on the readLine in CGIServlet.sendToLog.
> 
> We use Tomcat 5.5.25.
> Any suggestion?
> 
> Thanks
> /Gunnar
> 
> 
> 
>> -----Ursprungligt meddelande-----
>> Från: Christopher Schultz [mailto:chris@christopherschultz.net] 
>> Skickat: den 19 februari 2009 16:29
>> Till: Tomcat Users List
>> Ämne: Re: SV: SV: When will tomcat 5.5.25 spawn a new process
>>
> Gunnar,
> 
> On 2/19/2009 8:42 AM, Gunnar.Bostrom@tieto.com wrote:
>>>> I tried kill -3 on the pids but did not get any output.
> Note that stdout is usually written to catalina.out. Check 
> there for a thread dump.
> 
>>>> We use jsvc to start tomcat so we can run on port 443 
> without being root.
>>>> When started I see the expected 2 processes. 
>>>> One day we started tomcat around 10 pm and the first extra 
> process started around 9 am next day.
>>>> I don't think the load is high either.
> Are the child processes running java or perl?
> 
> -chris
> 
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


SV: SV: SV: When will tomcat 5.5.25 spawn a new process

Posted by Gu...@tieto.com.
Hi,
I think there is some problem (rarely) when calling CGI.
For each "daemon" tomcat process I can see 2 threads like this:

"Thread-68" daemon prio=10 tid=0x003ee348 nid=0xac runnable [0xacb7f000..0xacb7fa70]
	at java.io.FileInputStream.readBytes(Native Method)
	at java.io.FileInputStream.read(Unknown Source)
	at java.lang.UNIXProcess$DeferredCloseInputStream.read(Unknown Source)
	at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
	at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
	at sun.nio.cs.StreamDecoder.read(Unknown Source)
	- locked <0xb9d46378> (a java.io.InputStreamReader)
	at java.io.InputStreamReader.read(Unknown Source)
	at java.io.BufferedReader.fill(Unknown Source)
	at java.io.BufferedReader.readLine(Unknown Source)
	- locked <0xb9d46378> (a java.io.InputStreamReader)
	at java.io.BufferedReader.readLine(Unknown Source)
	at org.apache.catalina.servlets.CGIServlet$CGIRunner.sendToLog(CGIServlet.java:1860)
	at org.apache.catalina.servlets.CGIServlet$CGIRunner.access$400(CGIServlet.java:1435)
	at org.apache.catalina.servlets.CGIServlet$1.run(CGIServlet.java:1709)

"process reaper" daemon prio=10 tid=0x003ee040 nid=0xab runnable [0xad97f000..0xad97f8f0]
	at java.lang.UNIXProcess.waitForProcessExit(Native Method)
	at java.lang.UNIXProcess.access$900(Unknown Source)
	at java.lang.UNIXProcess$2$1.run(Unknown Source)


It seems to hang on the readLine in CGIServlet.sendToLog.

We use Tomcat 5.5.25.
Any suggestion?

Thanks
/Gunnar



> -----Ursprungligt meddelande-----
> Från: Christopher Schultz [mailto:chris@christopherschultz.net] 
> Skickat: den 19 februari 2009 16:29
> Till: Tomcat Users List
> Ämne: Re: SV: SV: When will tomcat 5.5.25 spawn a new process
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Gunnar,
> 
> On 2/19/2009 8:42 AM, Gunnar.Bostrom@tieto.com wrote:
> > I tried kill -3 on the pids but did not get any output.
> 
> Note that stdout is usually written to catalina.out. Check 
> there for a thread dump.
> 
> > We use jsvc to start tomcat so we can run on port 443 
> without being root.
> > When started I see the expected 2 processes. 
> > One day we started tomcat around 10 pm and the first extra 
> process started around 9 am next day.
> > I don't think the load is high either.
> 
> Are the child processes running java or perl?
> 
> - -chris
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkmderkACgkQ9CaO5/Lv0PAt3wCdGv1ykLozukR1jl0uD4jFT9bR
> oy0AnRjyEnMq2SCzWUds6/SRi9iPv1cj
> =Ue2X
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


SV: SV: SV: SV: When will tomcat 5.5.25 spawn a new process

Posted by Gu...@tieto.com.
Chris,
I agree that it looks weird.
I sometimes can se the perl process running but not at this moment.
When we start tomcat then we get the 19966 process owned by root and the child process 19967. 
The others turns up later as childs to 19967.
I don't see any process run by java!

Thanks
/Gunnar


> -----Ursprungligt meddelande-----
> Från: Christopher Schultz [mailto:chris@christopherschultz.net] 
> Skickat: den 20 februari 2009 14:24
> Till: Tomcat Users List
> Ämne: Re: SV: SV: SV: When will tomcat 5.5.25 spawn a new process
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Gunnar,
> 
> On 2/20/2009 2:49 AM, Gunnar.Bostrom@tieto.com wrote:
> > But I don't get any output from the "daemon" processes, but 
> I do get 
> > it from the tomcat process that consumes cpu
> > 
> > I think that the "daemon" processes runs java.
> > ps -ef | grep tomcat
> >  serfapp 15158 19967   0 09:38:19 ?           0:00 
> /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home 
> /usr/local/java -Dca
> >     root 19966     1   0 22:23:39 ?           0:00 
> /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home 
> /usr/local/java -Dca
> >  serfapp 16888 19967   0 10:19:37 ?           0:00 
> /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home 
> /usr/local/java -Dca
> >  serfapp 18086 19967   0 10:50:36 ?           0:00 
> /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home 
> /usr/local/java -Dca
> >  serfapp 18690 18518   0 11:05:18 pts/1       0:00 grep tomcat
> >  serfapp 14746 19967   0 09:25:56 ?           0:00 
> /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home 
> /usr/local/java -Dca
> >  serfapp 14741 19967   0 09:24:54 ?           0:00 
> /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home 
> /usr/local/java -Dca
> >  serfapp 19967 19966   0 22:23:39 ?          67:14 
> /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home 
> /usr/local/java -Dca
> >  serfapp 15917 19967   0 09:55:52 ?           0:00 
> /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home 
> /usr/local/java -Dca
> >  serfapp 17357 19967   0 10:34:05 ?           0:00 
> /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home 
> /usr/local/java -Dca
> 
> This is a weird-looking 'ps' output. I would expect to see a 
> /single/ process named 'jsvc', a bunch of processes running 
> 'java' and then maybe some processes running your external 
> CGI (perl, bash, etc.).
> 
> Obviously, you've run "grep tomcat" to filter the ps listing 
> so it might not be showing those other things.
> 
> jsvc should be claiming port numbers, then calling fork/exec 
> exactly once, replacing the child jsvc process with the java 
> process... there shouldn't be that many jsvc processes lying 
> around. <shrug>
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkmertkACgkQ9CaO5/Lv0PAZlwCgkKi0vaQZibSo1oO0RGfzyb68
> I60AoLCTzmS/xgyZ10B/M/05Up2qUxhM
> =j0Xb
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: SV: SV: SV: When will tomcat 5.5.25 spawn a new process

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gunnar,

On 2/20/2009 2:49 AM, Gunnar.Bostrom@tieto.com wrote:
> But I don't get any output from the "daemon" processes, but I do get it from the tomcat process that consumes cpu
> 
> I think that the "daemon" processes runs java.
> ps -ef | grep tomcat
>  serfapp 15158 19967   0 09:38:19 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
>     root 19966     1   0 22:23:39 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
>  serfapp 16888 19967   0 10:19:37 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
>  serfapp 18086 19967   0 10:50:36 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
>  serfapp 18690 18518   0 11:05:18 pts/1       0:00 grep tomcat
>  serfapp 14746 19967   0 09:25:56 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
>  serfapp 14741 19967   0 09:24:54 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
>  serfapp 19967 19966   0 22:23:39 ?          67:14 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
>  serfapp 15917 19967   0 09:55:52 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
>  serfapp 17357 19967   0 10:34:05 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca

This is a weird-looking 'ps' output. I would expect to see a /single/
process named 'jsvc', a bunch of processes running 'java' and then maybe
some processes running your external CGI (perl, bash, etc.).

Obviously, you've run "grep tomcat" to filter the ps listing so it might
not be showing those other things.

jsvc should be claiming port numbers, then calling fork/exec exactly
once, replacing the child jsvc process with the java process... there
shouldn't be that many jsvc processes lying around. <shrug>

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmertkACgkQ9CaO5/Lv0PAZlwCgkKi0vaQZibSo1oO0RGfzyb68
I60AoLCTzmS/xgyZ10B/M/05Up2qUxhM
=j0Xb
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


SV: SV: SV: When will tomcat 5.5.25 spawn a new process

Posted by Gu...@tieto.com.
Chris,
You are right, I get the result of kill -3 in catalina.out.
But I don't get any output from the "daemon" processes, but I do get it from the tomcat process that consumes cpu

I think that the "daemon" processes runs java.
ps -ef | grep tomcat
 serfapp 15158 19967   0 09:38:19 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
    root 19966     1   0 22:23:39 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
 serfapp 16888 19967   0 10:19:37 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
 serfapp 18086 19967   0 10:50:36 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
 serfapp 18690 18518   0 11:05:18 pts/1       0:00 grep tomcat
 serfapp 14746 19967   0 09:25:56 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
 serfapp 14741 19967   0 09:24:54 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
 serfapp 19967 19966   0 22:23:39 ?          67:14 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
 serfapp 15917 19967   0 09:55:52 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca
 serfapp 17357 19967   0 10:34:05 ?           0:00 /usr/local/tomcat/bin/jsvc -jvm server -user serfapp -home /usr/local/java -Dca

Thanks
/Gunnnar


> -----Ursprungligt meddelande-----
> Från: Christopher Schultz [mailto:chris@christopherschultz.net] 
> Skickat: den 19 februari 2009 16:29
> Till: Tomcat Users List
> Ämne: Re: SV: SV: When will tomcat 5.5.25 spawn a new process
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Gunnar,
> 
> On 2/19/2009 8:42 AM, Gunnar.Bostrom@tieto.com wrote:
> > I tried kill -3 on the pids but did not get any output.
> 
> Note that stdout is usually written to catalina.out. Check 
> there for a thread dump.
> 
> > We use jsvc to start tomcat so we can run on port 443 
> without being root.
> > When started I see the expected 2 processes. 
> > One day we started tomcat around 10 pm and the first extra 
> process started around 9 am next day.
> > I don't think the load is high either.
> 
> Are the child processes running java or perl?
> 
> - -chris
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkmderkACgkQ9CaO5/Lv0PAt3wCdGv1ykLozukR1jl0uD4jFT9bR
> oy0AnRjyEnMq2SCzWUds6/SRi9iPv1cj
> =Ue2X
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: SV: SV: When will tomcat 5.5.25 spawn a new process

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gunnar,

On 2/19/2009 8:42 AM, Gunnar.Bostrom@tieto.com wrote:
> I tried kill -3 on the pids but did not get any output.

Note that stdout is usually written to catalina.out. Check there for a
thread dump.

> We use jsvc to start tomcat so we can run on port 443 without being root.
> When started I see the expected 2 processes. 
> One day we started tomcat around 10 pm and the first extra process started around 9 am next day.
> I don't think the load is high either.

Are the child processes running java or perl?

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmderkACgkQ9CaO5/Lv0PAt3wCdGv1ykLozukR1jl0uD4jFT9bR
oy0AnRjyEnMq2SCzWUds6/SRi9iPv1cj
=Ue2X
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


SV: SV: When will tomcat 5.5.25 spawn a new process

Posted by Gu...@tieto.com.
Hi Mark,
I tried kill -3 on the pids but did not get any output.

We use jsvc to start tomcat so we can run on port 443 without being root.
When started I see the expected 2 processes. 
One day we started tomcat around 10 pm and the first extra process started around 9 am next day.
I don't think the load is high either.

Thanks
/Gunnar



> -----Ursprungligt meddelande-----
> Från: Mark Thomas [mailto:markt@apache.org] 
> Skickat: den 19 februari 2009 14:16
> Till: Tomcat Users List
> Ämne: Re: SV: When will tomcat 5.5.25 spawn a new process
> 
> Gunnar.Bostrom@tieto.com wrote:
> > Hi,
> > We use CGI to spawn Perl processes and I can see them start 
> up and disappear.
> > But I'm seeing what's look like ordinary tomcat processes 
> which don't uses any cpu.
> > Thanks
> > /Gunnar
> 
> Failed starts? Instances that haven't shutdown properly. What 
> happens if you issue a kill -3 <pid> ? You should get a stack 
> trace on stdout.
> 
> Mark
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: SV: When will tomcat 5.5.25 spawn a new process

Posted by Mark Thomas <ma...@apache.org>.
Gunnar.Bostrom@tieto.com wrote:
> Hi,
> We use CGI to spawn Perl processes and I can see them start up and disappear.
> But I'm seeing what's look like ordinary tomcat processes which don't uses any cpu.
> Thanks
> /Gunnar

Failed starts? Instances that haven't shutdown properly. What happens if
you issue a kill -3 <pid> ? You should get a stack trace on stdout.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


SV: When will tomcat 5.5.25 spawn a new process

Posted by Gu...@tieto.com.
Hi,
We use CGI to spawn Perl processes and I can see them start up and disappear.
But I'm seeing what's look like ordinary tomcat processes which don't uses any cpu.
Thanks
/Gunnar


> -----Ursprungligt meddelande-----
> Från: Mark Thomas [mailto:markt@apache.org] 
> Skickat: den 19 februari 2009 13:32
> Till: Tomcat Users List
> Ämne: Re: When will tomcat 5.5.25 spawn a new process
> 
> Gunnar.Bostrom@tieto.com wrote:
> > Hi,
> > When will Tomcat 5.5.25 spawn a new process on a Solaris 10 server?
> > I mean a normal process and not a light weight process.
> 
> Whenever there is a call to Runtime.exec()
> 
> The only ones I am aware of are:
> - the CGI servlet
> - the SSI servlet if you use cmd
> 
> Mark
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: When will tomcat 5.5.25 spawn a new process

Posted by Mark Thomas <ma...@apache.org>.
Gunnar.Bostrom@tieto.com wrote:
> Hi,
> When will Tomcat 5.5.25 spawn a new process on a Solaris 10 server?
> I mean a normal process and not a light weight process.

Whenever there is a call to Runtime.exec()

The only ones I am aware of are:
- the CGI servlet
- the SSI servlet if you use cmd

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org