Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-08-04 Thread Pid
On 02/08/2011 02:11, Christopher Schultz wrote:
  public HTMLEncoder() { mapChar2HTMLEntity= new HashMap(); int
  longueur = characters.length;
  
  for (int i = 0; i  longueur; i++) mapChar2HTMLEntity.put(new
  Character(characters[i]), entities[i]); }
 So you have Character - String (entity reference). Your Map is not
 synchronized, but it doesn't have to be: you are only calling get() on
 it so there shouldn't be any synchronization issues here.

The static 'mapChar2HTMLEntity' field is re-initialised each time a new
instance is created.

If a read event is occurring in another thread at the same time, what
will happen?


p


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



Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-08-03 Thread Alejandro Henao González
Thanks to all. The problem was the static hashmap. I removed the static keyword 
to the variable and problem solved.

- Mensaje original -

De: Christopher Schultz ch...@christopherschultz.net
Para: Tomcat Users List users@tomcat.apache.org
Enviados: Lunes, 1 de Agosto 2011 20:11:27
Asunto: Re: Problem with threads in stage Service (Tomcat 7.0.14)

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Alejandro,

On 7/29/2011 11:55 AM, Alejandro Henao González wrote:
 public class HTMLEncoder { private static Map mapChar2HTMLEntity;

 private final static char [] characters = {
 'á','ú','ó','é','í','ñ','Á','Ú','Ó','É','Í','°','ü' }; private final
 static String[] entities = {
 aacute;,uacute;,oacute;,eacute;,iacute;,ntilde;,Aacute;,Uacute;,Oacute;,Eacute;,Iacute;,deg;,uuml;
 };

 public HTMLEncoder() { mapChar2HTMLEntity= new HashMap(); int
 longueur = characters.length;

 for (int i = 0; i  longueur; i++) mapChar2HTMLEntity.put(new
 Character(characters[i]), entities[i]); }

So you have Character - String (entity reference). Your Map is not
synchronized, but it doesn't have to be: you are only calling get() on
it so there shouldn't be any synchronization issues here.

 public String encode(String s) { int longueur = s.length(); final
 StringBuffer sb = new StringBuffer(longueur * 2);

Big buffer every time?

 char ch;

 for (int i =0; i  longueur ; ++i) { ch = s.charAt(i);

 if ((ch = 63  ch = 90) || (ch = 97  ch = 122)) sb.append(ch);
 else { String ss = (String)mapChar2HTMLEntity.get(new
 Character(ch));

New Character object every time? Mmm. You might want to choose a more
optimized storage system so you don't have to create a new object every
time.

 if(ss==null) sb.append(ch); else sb.append(ss); } } return
 sb.toString(); }

Aside from any other strange issues you are having, you might be wasting
a lot of time (and invoking a lot of GC) by creating a large
StringBuffer for every invocation. You might want some more complicated
logic to determine if you even need to create such a buffer.

Honestly, I don't see much wrong with this class. I don't see any use of
System.gc and I don't see any connection reset. Was there a post that I
missed?

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

iEYEARECAAYFAk43Tr4ACgkQ9CaO5/Lv0PBk4QCglB4MNYVbEvwsqZFwiOYupAUv
J84AnRAnw2o6PwTRiaNnNFc9iyNq0pUS
=UWQu
-END PGP SIGNATURE-

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




Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-08-01 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Alejandro,

On 7/29/2011 11:55 AM, Alejandro Henao González wrote:
 public class HTMLEncoder { private static Map mapChar2HTMLEntity;
 
 private final static char [] characters = { 
 'á','ú','ó','é','í','ñ','Á','Ú','Ó','É','Í','°','ü' }; private final
 static String[] entities = { 
 aacute;,uacute;,oacute;,eacute;,iacute;,ntilde;,Aacute;,Uacute;,Oacute;,Eacute;,Iacute;,deg;,uuml;
  };
 
 public HTMLEncoder() { mapChar2HTMLEntity= new HashMap(); int
 longueur = characters.length;
 
 for (int i = 0; i  longueur; i++) mapChar2HTMLEntity.put(new
 Character(characters[i]), entities[i]); }

So you have Character - String (entity reference). Your Map is not
synchronized, but it doesn't have to be: you are only calling get() on
it so there shouldn't be any synchronization issues here.

 public String encode(String s) { int longueur = s.length(); final
 StringBuffer sb = new StringBuffer(longueur * 2);

Big buffer every time?

 char ch;
 
 for (int i =0; i  longueur ; ++i) { ch = s.charAt(i);
 
 if ((ch = 63  ch = 90) || (ch = 97  ch = 122)) sb.append(ch);
  else { String ss = (String)mapChar2HTMLEntity.get(new
 Character(ch));

New Character object every time? Mmm. You might want to choose a more
optimized storage system so you don't have to create a new object every
time.

 if(ss==null) sb.append(ch); else sb.append(ss); } } return
 sb.toString(); }

Aside from any other strange issues you are having, you might be wasting
a lot of time (and invoking a lot of GC) by creating a large
StringBuffer for every invocation. You might want some more complicated
logic to determine if you even need to create such a buffer.

Honestly, I don't see much wrong with this class. I don't see any use of
System.gc and I don't see any connection reset. Was there a post that I
missed?

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

iEYEARECAAYFAk43Tr4ACgkQ9CaO5/Lv0PBk4QCglB4MNYVbEvwsqZFwiOYupAUv
J84AnRAnw2o6PwTRiaNnNFc9iyNq0pUS
=UWQu
-END PGP SIGNATURE-

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



Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-29 Thread Pid
On 28/07/2011 20:07, Alejandro Henao González wrote:
 I dont believe that have GC running all the time, but the GC is called in the 
 above line to HTMLEncoder.encode. as follows. 
 
 System.gc(); 

 resultado = htmlEncoder.encode(resultado); 

Is 'htmlEncoder' a static field, an instance field or defined inside the
method scope?

 response.reset(); 

Why are you resetting the response?


p

 may be this the problem? why? 
 
 
 Thanks. 
 
 - Mensaje original -
 
 De: Filip Hanik - Dev Lists devli...@hanik.com 
 Para: Tomcat Users List users@tomcat.apache.org 
 Enviados: Jueves, 28 de Julio 2011 12:35:56 
 Asunto: Re: Problem with threads in stage Service (Tomcat 7.0.14) 
 
 most likely you have GC running all the time 
 
 http-bio-80-exec-107 daemon prio=10 tid=0x2aaab31ea000 nid=0x47b2 
 runnable [0x436ab000] 
 java.lang.Thread.State: RUNNABLE 
 at java.util.HashMap.get(HashMap.java:303) 
 at sae.HTMLEncoder.encode(HTMLEncoder.java:46) 
 
 this should not be a stage where you're stuck, unless you have a loop 
 problem. 
 
 
 
 
 
 On 7/28/2011 9:09 AM, Alejandro Henao González wrote: 
 Good day. 

 I have the following problem with my tomcat. 

 Sometimes, some threads are keep in service stage for a long time (really 
 never exit from this stage), this causes that tomcat uses a 
 hight percentage of the CPU (100 % of 2 or 3 cores) thus the webapp executes 
 very slow. 

 I have a Tomcat 7.0.14 in a Redhat RHLE 5.5. 

 The partial solution is restart the service, but this is not a practical 
 solution(because is a 24/7 server). is posible config a timeout 
 for threads in service stage, or any solution?? 

 Thanks. Sorry for the redaction. Attached an image with the tomcat manager 
 status and the CPU consuming. 


  

 Cordial saludo. 

 Tengo el siguiente problema con mi tomcat. 
 En algunas ocasiones, algunos hilos se quedan en la etapa de servicio por 
 demasiado tiempo (de hecho nunca salen de esta etapa), esto 
 causa que el tomcat use un alto porcenta de la CPU (el 100 % de 2 o 3 
 núcluos incluso hasta los 8 a veces), y en consecuencia mi 
 aplicación web trabaja demasiado lento. 

 Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5 

 La solución temporal que tengo es reiniciar el servicio, sin embargo esta no 
 es una solución práctica (pues debe ser un servidor 24/7). Es 
 posible configurar algún timeout para hilos en la etapa de servicio, o 
 alguna solución alternativa para este problema? 

 Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat 
 Manager, y el uso de la CPU 


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


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



Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-29 Thread André Warnier

Pid wrote:

On 28/07/2011 20:07, Alejandro Henao González wrote:
I dont believe that have GC running all the time, but the GC is called in the above line to HTMLEncoder.encode. as follows. 

System.gc(); 

resultado = htmlEncoder.encode(resultado); 


Is 'htmlEncoder' a static field, an instance field or defined inside the
method scope?

response.reset(); 


Why are you resetting the response?



I'm not the real Java specialist here, but maybe one isn't really needed here.
The code above seems to suggest that this application is forcing a major garbage 
collection at every request (or more).  Is there a need to look anywhere else as to why 
this Tomcat is saturating the host's CPU and why threads are always suspended ?


(Philip already pointed this out, but maybe he wasn't forceful enough in making 
the point)

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



Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-29 Thread Pid
On 29/07/2011 08:41, André Warnier wrote:
 Pid wrote:
 On 28/07/2011 20:07, Alejandro Henao González wrote:
 I dont believe that have GC running all the time, but the GC is
 called in the above line to HTMLEncoder.encode. as follows.
 System.gc();
 resultado = htmlEncoder.encode(resultado); 

 Is 'htmlEncoder' a static field, an instance field or defined inside the
 method scope?

 response.reset(); 

 Why are you resetting the response?


 I'm not the real Java specialist here, but maybe one isn't really needed
 here.
 The code above seems to suggest that this application is forcing a major
 garbage collection at every request (or more).  Is there a need to look
 anywhere else as to why this Tomcat is saturating the host's CPU and why
 threads are always suspended ?
 
 (Philip already pointed this out, but maybe he wasn't forceful enough in
 making the point)

The GC will cause problems, yes.

I am wondering whether the htmlEncoder is thread-safe too.
The response.reset() may be superfluous.

Just a little extra help...


p


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



Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-29 Thread Rainer Jung
On 28.07.2011 21:20, Filip Hanik - Dev Lists wrote:
 that's an academic exercise for you, in the meantime, add in this option
 to your startup options
 -XX:-DisableExplicitGC

I think Filip wanted to suggest -XX:+DisableExplicitGC

The plus or minus after the colon decides whether the switch is set or
unset. So in this case we want to set a disable switch (which will only
be a workaround).

Regards,

Rainer


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



Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-29 Thread Alejandro Henao González
ummm...
The option -XX:-DisableExplicitGC not solves the problem, may be with the 
+DisableExplicitGC, i will try it.


The method HTMLEncoder.encode is static and uses a HashMap static. this is the 
class.



public class HTMLEncoder {
private static Map mapChar2HTMLEntity;

private final static char [] characters = {
'á','ú','ó','é','í','ñ','Á','Ú','Ó','É','Í','°','ü'
};
private final static String[] entities = {
aacute;,uacute;,oacute;,eacute;,iacute;,ntilde;,Aacute;,Uacute;,Oacute;,Eacute;,Iacute;,deg;,uuml;
};

public HTMLEncoder() {
mapChar2HTMLEntity= new HashMap();
int longueur = characters.length;

for (int i = 0; i  longueur; i++)
mapChar2HTMLEntity.put(new Character(characters[i]), entities[i]);
}

public String encode(String s) {
int longueur = s.length();
final StringBuffer sb = new StringBuffer(longueur * 2);

char ch;

for (int i =0; i  longueur ; ++i) {
ch = s.charAt(i);

if ((ch = 63  ch = 90) || (ch = 97  ch = 122))
sb.append(ch);
else {
String ss = (String)mapChar2HTMLEntity.get(new Character(ch));


if(ss==null)
sb.append(ch);
else
sb.append(ss);
}
}
return sb.toString();
}


public StringBuffer encode(StringBuffer s) {
int longueur = s.length();
final StringBuffer sb = new StringBuffer(longueur * 2);


char ch;


for (int i =0; i  longueur ; ++i) {
ch = s.charAt(i);


if ((ch = 63  ch = 90) || (ch = 97  ch = 122))
sb.append(ch);
else {
String ss = (String)mapChar2HTMLEntity.get(new Character(ch));


if(ss==null)
sb.append(ch);
else
sb.append(ss);
}
}
return sb;
}
}
- Mensaje original -

De: Rainer Jung rainer.j...@kippdata.de
Para: users@tomcat.apache.org
Enviados: Viernes, 29 de Julio 2011 5:05:37
Asunto: Re: Problem with threads in stage Service (Tomcat 7.0.14)

On 28.07.2011 21:20, Filip Hanik - Dev Lists wrote:
 that's an academic exercise for you, in the meantime, add in this option 
 to your startup options
 -XX:-DisableExplicitGC

I think Filip wanted to suggest -XX:+DisableExplicitGC

The plus or minus after the colon decides whether the switch is set or
unset. So in this case we want to set a disable switch (which will only
be a workaround).

Regards,

Rainer


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




Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-29 Thread André Warnier

Alejandro Henao González wrote:
ummm... 
The option -XX:-DisableExplicitGC not solves the problem, may be with the +DisableExplicitGC, i will try it. 


ummm..
A mystery for me is : since you have the source, why do you not just comment 
out the

system.gc();

line, and see what your Tomcat is then doing ?


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



Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-29 Thread Alejandro Henao González
I'm not sure that the problem is this. And, many JSPs have this line. may be 
origin of problem is the hashmap static, because the method HTMLEncoder.encode 
not is static and the construct of HTMLEncoder initialize the object.

- Mensaje original -

De: André Warnier a...@ice-sa.com
Para: Tomcat Users List users@tomcat.apache.org
Enviados: Viernes, 29 de Julio 2011 12:36:21
Asunto: Re: Problem with threads in stage Service (Tomcat 7.0.14)

Alejandro Henao González wrote:
 ummm...
 The option -XX:-DisableExplicitGC not solves the problem, may be with the 
 +DisableExplicitGC, i will try it.

ummm..
A mystery for me is : since you have the source, why do you not just comment 
out the

system.gc();

line, and see what your Tomcat is then doing ?


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




Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-29 Thread André Warnier

Alejandro Henao González wrote:

I'm not sure that the problem is this.
And, many JSPs have this line. 


Well, that would certainly multiply the problem, wouldn't it ?
Do you have any idea what these system.gc() were meant to achieve ?

Anyway, nothing that find and grep and a good text editor can't solve.

may be origin of problem is the hashmap static, because the method HTMLEncoder.encode not is static and the construct of HTMLEncoder initialize the object. 


If you are not sure of your HTMLEncoder class, there are quite a few available that are 
fully-tested.

A short search in Google for java html encoder shows a few, such as this one :

http://jtidy.sourceforge.net/multiproject/jtidyservlet/clover/org/w3c/tidy/servlet/util/HTMLEncode.html
(and there is another one in the Jakarta Commons).

Personally, instead of some kind of HashMap, I would just use a preset array of 
String[128] with the translations of the first 128 char values (translating the inocuous 
characters by themselves), and then translate everything else above 128 to #(char 
value);.  Intuitively, it would seem much faster than the complicated logic I see in 
these classes (and yours).

But then, since I am no great Java expert, I may be missing something.

Getting back to the system.gc() however, I am pretty sure that if every access to a JSP 
page on that system triggers a major GC, then there is no wonder about where your system's 
CPU time is being spent.
That is also what Philip seemed to say in his comment to your thread dump.  And he 
definitely is a Java and Tomcat expert.





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



Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-28 Thread Alejandro Henao González
Good day.


I have the following problem with my tomcat.


Sometimes, some threads are keep in service stage for a long time (really never 
exit from this stage), this causes that tomcat uses a hight percentage of the 
CPU (100 % of 2 or 3 cores) thus the webapp executes very slow.


I have a Tomcat 7.0.14 in a Redhat RHLE 5.5.


The partial solution is restart the service, but this is not a practical 
solution(because is a 24/7 server). is posible config a timeout for threads in 
service stage, or any solution??


Thanks. Sorry for the redaction. Attached an image with the tomcat manager 
status and the CPU consuming.







Cordial saludo.


Tengo el siguiente problema con mi tomcat.
En algunas ocasiones , algunos hilos se quedan en la etapa de servicio por 
demasiado tiempo (de hecho nunca salen de esta etapa), esto causa que el tomcat 
use un alto porcenta de la CPU (el 100 % de 2 o 3 núcluos incluso hasta los 8 a 
veces), y en consecuencia mi aplicación web trabaja demasiado lento.


Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5


La solución temporal que tengo es reiniciar el servicio, sin embargo esta no es 
una solución práctica (pues debe ser un servidor 24/7). Es posible configurar 
algún timeout para hilos en la etapa de servicio, o alguna solución alternativa 
para este problema?


Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat 
Manager, y el uso de la CPU 
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-28 Thread Pid
On 28/07/2011 16:09, Alejandro Henao González wrote:
 Good day.
 
 I have the following problem with my tomcat.
 
 Sometimes, some threads are keep in service stage for a long time
 (really never exit from this stage), this causes that tomcat uses a
 hight percentage of the CPU (100 % of 2 or 3 cores) thus the webapp
 executes very slow.

Take a thread dump when this is occurring.

 http://wiki.apache.org/tomcat/FAQ/Troubleshooting_and_Diagnostics


p


 I have a Tomcat 7.0.14 in a Redhat RHLE 5.5. 
 
 The partial solution is restart the service, but this is not a practical
 solution(because is a 24/7 server). is posible config a timeout for
 threads in service stage, or any solution??
 
 Thanks. Sorry for the redaction. Attached an image with the tomcat
 manager status and the CPU consuming.
 
 
 
 
 Cordial saludo.
 
 Tengo el siguiente problema con mi tomcat.
 En algunas ocasiones, algunos hilos se quedan en la etapa de servicio
 por demasiado tiempo (de hecho nunca salen de esta etapa), esto causa
 que el tomcat use un alto porcenta de la CPU (el 100 % de 2 o 3 núcluos
 incluso hasta los 8 a veces), y en consecuencia mi aplicación web
 trabaja demasiado lento.
 
 Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5 
 
 La solución temporal que tengo es reiniciar el servicio, sin embargo
 esta no es una solución práctica (pues debe ser un servidor 24/7). Es
 posible configurar algún timeout para hilos en la etapa de servicio, o
 alguna solución alternativa para este problema? 
 
 Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat
 Manager, y el uso de la CPU
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


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



Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-28 Thread Alejandro Henao González
 thread#6 (ParallelGC) prio=10 tid=0x40df5000 nid=0x1ee3 
runnable

GC task thread#7 (ParallelGC) prio=10 tid=0x40df6800 nid=0x1ee4 
runnable

VM Periodic Task Thread prio=10 tid=0x2aaab2495800 nid=0x1eec waiting on 
condition

JNI global references: 1425



- Mensaje original -

De: Pid p...@pidster.com
Para: Tomcat Users List users@tomcat.apache.org
Enviados: Jueves, 28 de Julio 2011 10:44:37
Asunto: Re: Problem with threads in stage Service (Tomcat 7.0.14)

On 28/07/2011 16:09, Alejandro Henao González wrote:
 Good day.

 I have the following problem with my tomcat.

 Sometimes, some threads are keep in service stage for a long time
 (really never exit from this stage), this causes that tomcat uses a
 hight percentage of the CPU (100 % of 2 or 3 cores) thus the webapp
 executes very slow.

Take a thread dump when this is occurring.

http://wiki.apache.org/tomcat/FAQ/Troubleshooting_and_Diagnostics


p


 I have a Tomcat 7.0.14 in a Redhat RHLE 5.5.

 The partial solution is restart the service, but this is not a practical 
 solution(because is a 24/7 server). is posible config a timeout for
 threads in service stage, or any solution??

 Thanks. Sorry for the redaction. Attached an image with the tomcat
 manager status and the CPU consuming.


 

 Cordial saludo.

 Tengo el siguiente problema con mi tomcat.
 En algunas ocasiones, algunos hilos se quedan en la etapa de servicio
 por demasiado tiempo (de hecho nunca salen de esta etapa), esto causa
 que el tomcat use un alto porcenta de la CPU (el 100 % de 2 o 3 núcluos
 incluso hasta los 8 a veces), y en consecuencia mi aplicación web
 trabaja demasiado lento.

 Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5

 La solución temporal que tengo es reiniciar el servicio, sin embargo
 esta no es una solución práctica (pues debe ser un servidor 24/7). Es
 posible configurar algún timeout para hilos en la etapa de servicio, o
 alguna solución alternativa para este problema?

 Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat
 Manager, y el uso de la CPU



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


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




Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-28 Thread Filip Hanik - Dev Lists

most likely you have GC running all the time

http-bio-80-exec-107 daemon prio=10 tid=0x2aaab31ea000 nid=0x47b2 
runnable [0x436ab000]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.get(HashMap.java:303)
at sae.HTMLEncoder.encode(HTMLEncoder.java:46)

this should not be a stage where you're stuck, unless you have a loop problem.





On 7/28/2011 9:09 AM, Alejandro Henao González wrote:

Good day.

I have the following problem with my tomcat.

Sometimes, some threads are keep in service stage for a long time (really never exit from this stage), this causes that tomcat uses a 
hight percentage of the CPU (100 % of 2 or 3 cores) thus the webapp executes very slow.


I have a Tomcat 7.0.14 in a Redhat RHLE 5.5.

The partial solution is restart the service, but this is not a practical solution(because is a 24/7 server). is posible config a timeout 
for threads in service stage, or any solution??


Thanks. Sorry for the redaction. Attached an image with the tomcat manager 
status and the CPU consuming.




Cordial saludo.

Tengo el siguiente problema con mi tomcat.
En algunas ocasiones, algunos hilos se quedan en la etapa de servicio por demasiado tiempo (de hecho nunca salen de esta etapa), esto 
causa que el tomcat use un alto porcenta de la CPU (el 100 % de 2 o 3 núcluos incluso hasta los 8 a veces), y en consecuencia mi 
aplicación web trabaja demasiado lento.


Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5

La solución temporal que tengo es reiniciar el servicio, sin embargo esta no es una solución práctica (pues debe ser un servidor 24/7). Es 
posible configurar algún timeout para hilos en la etapa de servicio, o alguna solución alternativa para este problema?


Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat 
Manager, y el uso de la CPU


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



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



Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-28 Thread Alejandro Henao González
I dont believe that have GC running all the time, but the GC is called in the 
above line to HTMLEncoder.encode. as follows.



System.gc();


resultado = htmlEncoder.encode(resultado);
response.reset();


may be this the problem? why?


Thanks.

- Mensaje original -

De: Filip Hanik - Dev Lists devli...@hanik.com
Para: Tomcat Users List users@tomcat.apache.org
Enviados: Jueves, 28 de Julio 2011 12:35:56
Asunto: Re: Problem with threads in stage Service (Tomcat 7.0.14)

most likely you have GC running all the time

http-bio-80-exec-107 daemon prio=10 tid=0x2aaab31ea000 nid=0x47b2 
runnable [0x436ab000]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.get(HashMap.java:303)
at sae.HTMLEncoder.encode(HTMLEncoder.java:46)

this should not be a stage where you're stuck, unless you have a loop problem.





On 7/28/2011 9:09 AM, Alejandro Henao González wrote:
 Good day.

 I have the following problem with my tomcat.

 Sometimes, some threads are keep in service stage for a long time (really 
 never exit from this stage), this causes that tomcat uses a
 hight percentage of the CPU (100 % of 2 or 3 cores) thus the webapp executes 
 very slow.

 I have a Tomcat 7.0.14 in a Redhat RHLE 5.5.

 The partial solution is restart the service, but this is not a practical 
 solution(because is a 24/7 server). is posible config a timeout
 for threads in service stage, or any solution??

 Thanks. Sorry for the redaction. Attached an image with the tomcat manager 
 status and the CPU consuming.


 

 Cordial saludo.

 Tengo el siguiente problema con mi tomcat.
 En algunas ocasiones, algunos hilos se quedan en la etapa de servicio por 
 demasiado tiempo (de hecho nunca salen de esta etapa), esto
 causa que el tomcat use un alto porcenta de la CPU (el 100 % de 2 o 3 núcluos 
 incluso hasta los 8 a veces), y en consecuencia mi
 aplicación web trabaja demasiado lento.

 Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5

 La solución temporal que tengo es reiniciar el servicio, sin embargo esta no 
 es una solución práctica (pues debe ser un servidor 24/7). Es
 posible configurar algún timeout para hilos en la etapa de servicio, o alguna 
 solución alternativa para este problema?

 Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat 
 Manager, y el uso de la CPU


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


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




Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-28 Thread Filip Hanik - Dev Lists

that's an academic exercise for you, in the meantime, add in this option to 
your startup options
-XX:-DisableExplicitGC

Filip

On 7/28/2011 1:07 PM, Alejandro Henao González wrote:

I dont believe that have GC running all the time, but the GC is called in the 
above line to HTMLEncoder.encode. as follows.



System.gc();


resultado = htmlEncoder.encode(resultado);
response.reset();


may be this the problem? why?


Thanks.

- Mensaje original -

De: Filip Hanik - Dev Listsdevli...@hanik.com
Para: Tomcat Users Listusers@tomcat.apache.org
Enviados: Jueves, 28 de Julio 2011 12:35:56
Asunto: Re: Problem with threads in stage Service (Tomcat 7.0.14)

most likely you have GC running all the time

http-bio-80-exec-107 daemon prio=10 tid=0x2aaab31ea000 nid=0x47b2 
runnable [0x436ab000]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.get(HashMap.java:303)
at sae.HTMLEncoder.encode(HTMLEncoder.java:46)

this should not be a stage where you're stuck, unless you have a loop problem.





On 7/28/2011 9:09 AM, Alejandro Henao González wrote:

Good day.

I have the following problem with my tomcat.

Sometimes, some threads are keep in service stage for a long time (really never 
exit from this stage), this causes that tomcat uses a
hight percentage of the CPU (100 % of 2 or 3 cores) thus the webapp executes 
very slow.

I have a Tomcat 7.0.14 in a Redhat RHLE 5.5.

The partial solution is restart the service, but this is not a practical 
solution(because is a 24/7 server). is posible config a timeout
for threads in service stage, or any solution??

Thanks. Sorry for the redaction. Attached an image with the tomcat manager 
status and the CPU consuming.




Cordial saludo.

Tengo el siguiente problema con mi tomcat.
En algunas ocasiones, algunos hilos se quedan en la etapa de servicio por 
demasiado tiempo (de hecho nunca salen de esta etapa), esto
causa que el tomcat use un alto porcenta de la CPU (el 100 % de 2 o 3 núcluos 
incluso hasta los 8 a veces), y en consecuencia mi
aplicación web trabaja demasiado lento.

Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5

La solución temporal que tengo es reiniciar el servicio, sin embargo esta no es 
una solución práctica (pues debe ser un servidor 24/7). Es
posible configurar algún timeout para hilos en la etapa de servicio, o alguna 
solución alternativa para este problema?

Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat 
Manager, y el uso de la CPU


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


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






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



Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-28 Thread Alejandro Henao González
Ok. i will trie with this option.

- Mensaje original -

De: Filip Hanik - Dev Lists devli...@hanik.com
Para: Tomcat Users List users@tomcat.apache.org
Enviados: Jueves, 28 de Julio 2011 14:20:26
Asunto: Re: Problem with threads in stage Service (Tomcat 7.0.14)

that's an academic exercise for you, in the meantime, add in this option to 
your startup options
-XX:-DisableExplicitGC

Filip

On 7/28/2011 1:07 PM, Alejandro Henao González wrote:
 I dont believe that have GC running all the time, but the GC is called in the 
 above line to HTMLEncoder.encode. as follows.



 System.gc();


 resultado = htmlEncoder.encode(resultado);
 response.reset();


 may be this the problem? why?


 Thanks.

 - Mensaje original -

 De: Filip Hanik - Dev Listsdevli...@hanik.com
 Para: Tomcat Users Listusers@tomcat.apache.org
 Enviados: Jueves, 28 de Julio 2011 12:35:56
 Asunto: Re: Problem with threads in stage Service (Tomcat 7.0.14)

 most likely you have GC running all the time

 http-bio-80-exec-107 daemon prio=10 tid=0x2aaab31ea000 nid=0x47b2 
 runnable [0x436ab000]
 java.lang.Thread.State: RUNNABLE
 at java.util.HashMap.get(HashMap.java:303)
 at sae.HTMLEncoder.encode(HTMLEncoder.java:46)

 this should not be a stage where you're stuck, unless you have a loop problem.





 On 7/28/2011 9:09 AM, Alejandro Henao González wrote:
 Good day.

 I have the following problem with my tomcat.

 Sometimes, some threads are keep in service stage for a long time (really 
 never exit from this stage), this causes that tomcat uses a
 hight percentage of the CPU (100 % of 2 or 3 cores) thus the webapp executes 
 very slow.

 I have a Tomcat 7.0.14 in a Redhat RHLE 5.5.

 The partial solution is restart the service, but this is not a practical 
 solution(because is a 24/7 server). is posible config a timeout
 for threads in service stage, or any solution??

 Thanks. Sorry for the redaction. Attached an image with the tomcat manager 
 status and the CPU consuming.


 

 Cordial saludo.

 Tengo el siguiente problema con mi tomcat.
 En algunas ocasiones, algunos hilos se quedan en la etapa de servicio por 
 demasiado tiempo (de hecho nunca salen de esta etapa), esto
 causa que el tomcat use un alto porcenta de la CPU (el 100 % de 2 o 3 
 núcluos incluso hasta los 8 a veces), y en consecuencia mi
 aplicación web trabaja demasiado lento.

 Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5

 La solución temporal que tengo es reiniciar el servicio, sin embargo esta no 
 es una solución práctica (pues debe ser un servidor 24/7). Es
 posible configurar algún timeout para hilos en la etapa de servicio, o 
 alguna solución alternativa para este problema?

 Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat 
 Manager, y el uso de la CPU


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

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





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