Author Topic: Queuemetrics / Java - High CPU Usage  (Read 5357 times)

WRP

  • Jr. Member
  • **
  • Posts: 57
  • Karma: 1
    • View Profile
Queuemetrics / Java - High CPU Usage
« on: March 02, 2010, 21:23:33 »
I've noticed via top that "java" is consistently using 100-300% CPU.  Is this normal?  It's putting a significant load on our server, which isn't handling a very large call volume.  Here are some numbers to provide perspective:

System:
2x quad core 64 bit processors (in the neighborhood of 2.2Ghz I believe)
3GB memory


Configuration:
asterisk 1.4.29 x64, queuemetrics, freepbx 2.6
Four queues, three with ~12 agents, once with 2 agents
    (sip_additional.conf formatted as SIP/[exten] to reduce cpu overhead associated with freepbx local/[exten] + dialparties.agi)

Usage:
~20 total extensions
~6 queue calls during peak hours
~8 simultaneous calls during peak hours
 
I've included a screenshot of top to show the high CPU usage of "java".  Also to note: I realized that I had about 30GB of java logs from tomcat after running queuemetrics for a little over a month.  Thinking that this level of logging might be slowing the system down, I disabled all logging.  This, unfortunately, did not make a noticeable difference.

Any advice is appreciated.  I can't imagine that queuemetrics actually runs this hot!



QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Queuemetrics / Java - High CPU Usage
« Reply #1 on: March 03, 2010, 09:28:59 »
The problem you have is that you are running with too few Java memory - so it keeps garbage collecting its heap space. Try and give it like a Gigs of RAM to run into and you'll see it will become way better.....

See http://queuemetrics.com/faq.jsp#faq-003


WRP

  • Jr. Member
  • **
  • Posts: 57
  • Karma: 1
    • View Profile
Re: Queuemetrics / Java - High CPU Usage
« Reply #2 on: March 03, 2010, 19:23:26 »
Hmm, that didn't seem to help the issue.  I changed /etc/init.d/queuemetrics to the following:

Code: [Select]
#!/bin/sh
# chkconfig: 345 20 80
# description: Starts/stops QueueMetrics' internal Tomcat

CATALINA_HOME=/usr/local/queuemetrics/tomcat; export CATALINA_HOME
JAVA_HOME=/usr/local/queuemetrics/java; export JAVA_HOME
JAVA_OPTS="-Xms1024M -Xmx1024M"
export JAVA_OPTS
TOMCAT_OWNER=root; export TOMCAT_OWNER

start() {
        echo -n "Starting QueueMetrics:  "
        su $TOMCAT_OWNER -c $CATALINA_HOME/bin/startup.sh
        sleep 2
}
stop() {
        echo -n "Stopping QueueMetrics: "
        su $TOMCAT_OWNER -c $CATALINA_HOME/bin/shutdown.sh
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        start
        ;;
  *)
        echo $"Usage: queuemetrics {start|stop|restart}"
        exit
esac

This gave it 10X the amount of memory (128MB to 1024MB).  I'm still seeing a java cpu utilization that bounces in 100% range and spikes to 250%-300%.  What is also interesting is that at night when there are no calls, it's still up there, though not quite as high.

Other ideas?

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Queuemetrics / Java - High CPU Usage
« Reply #3 on: March 04, 2010, 16:12:17 »
Do you see any activity? look at the QM logs....