I am seeing some issues where a hung up java process is consuming 100%
cpu
on 1 of 4 CPUs. This is hanging the JRuby app. Shouldn’t java be
threading
future requests to be used on other CPUs ?
I am seeing some issues where a hung up java process is consuming 100%
cpu on 1 of 4 CPUs. This is hanging the JRuby app. Shouldn’t java be
threading future requests to be used on other CPUs ?
Yes, unless that thread is holding a resource that the others need. Can
you try to get a stack dump to see where they’re stuf? It’s usually
Ctrl+\ or Ctrl+Break from the console where the app is running, or you
can ust jps+jstack.
I have attached the kill -3 output. Let me know if you guys see
anything
interesting here, hard for me to debug.
Also is there a way to optimize how many jruby processes get spawned for
an
app? What is a good number to use? Is thee a way to determine how many
are
being used ?
----- Original Message -----
From: “Charles Oliver N.” [email protected]
To: [email protected]
Sent: Wednesday, July 16, 2008 5:12:14 PM GMT -06:00 US/Canada Central
Subject: Re: [jruby-user] java and threading
AD wrote:
hello,
I am seeing some issues where a hung up java process is consuming 100%
cpu on 1 of 4 CPUs. This is hanging the JRuby app. Shouldn’t java be
threading future requests to be used on other CPUs ?
Yes, unless that thread is holding a resource that the others need. Can
you try to get a stack dump to see where they’re stuf? It’s usually
Ctrl+\ or Ctrl+Break from the console where the app is running, or you
can ust jps+jstack.
I have attached the kill -3 output. Let me know if you guys see
anything interesting here, hard for me to debug.
Also is there a way to optimize how many jruby processes get spawned for
an app? What is a good number to use? Is thee a way to determine how
many are being used ?
I’d say start with 2 and scale up as you need. It’s going to depend on
how fast your app responds and how many concurrent connections you need
to be able to handle.
Looking at your trace, there’s a big fat Permgen error at the top, which
would mean you need to bump that up. The default in the JVM is usually
around 64M, so you might try going up to 128M. FYI, the “permanent
generation” holds compiled code, among other things, so app servers
frequently need to bump it up if they’re deploying many apps (or many
instances of an app, as in this case).
modify tomcat startup to pass -XX:MaxPermSize=128M to set it.
We tried a few other things too where we set a Timeout::timeout but
seems to
have no affect in tomcat only in mongrel under JRuby interestingly
enough.
The issue seems to relate to a syncronous process not responding (remote
http call), but I am trying to figure out why it is making the whole app
unresponsive to other users.
Thx
Adam
On Thu, Jul 17, 2008 at 4:57 PM, Charles Oliver N. <