1

I have problem on my instance that Java uses more than 100% CPU. Also, by writing "top" command, i saw 1400%-2200%. You can see that from picture. Also i added "top -H" command output.

I changed my instance type and increase CPU 8x times but never changed. I removed plugins but nothing changed. I set xmpp.pep.enabled false but nothing changed.

The Java only used by Openfire server and i tried many things. Also the configuration is below. When i restarted the instance or openfire server, it works fine. But after 5 min. it downs again.

Also there are only 1000 users in online session. There are 32 CPU and 60 GB Memory.

How can i decrease CPU usage? Thank you.

OPENFIRE_OPTS="-Xms256m -Xmx56096m -Xss256k -Xoss256k -XX:ThreadStackSize=256"
INSTALL4J_ADD_VM_PARAMS="-Djava.net.preferIPv4Stack=true -Xms256m -Xmx56096m -Xss256k -Xoss256k -XX:ThreadStackSize=256"
DAEMON_OPTS="-Xms256m -Xmx56096m -Xss256k -Xoss256k -XX:ThreadStackSize=256"

top command on my instance

top -H command

iravul
  • 408
  • 9
  • 15
  • What's your question? I don't understand what you're trying to "fix". – chrylis -cautiouslyoptimistic- Nov 03 '14 at 12:31
  • @chrylis how can i decrease CPU usage of Java? Because it seems too high with this instance capacity. – iravul Nov 03 '14 at 12:34
  • You want to forcefully limit the amount of CPU resources available to the `java` process? http://www.howtoforge.com/how-to-limit-cpu-usage-with-cpulimit-on-ubuntu-linux – Marko Topolnik Nov 03 '14 at 12:35
  • Why do you say "too high"? It looks like this is the only service running on that VM. If so, the CPU numbers are just an artifact of how CPU time gets reported in virtualized guests, and don't worry about it. (For what it's worth, though, it looks like you're seriously underutilizing your memory. Perhaps look at a high-CPU instance type.) – chrylis -cautiouslyoptimistic- Nov 03 '14 at 12:42
  • @MarkoTopolnik i want from my Instance to handle Java cpu usage and hold it lower than 100%. Because if java higher than 100%, openfire server not works. – iravul Nov 03 '14 at 12:46
  • @chrylis if CPU of Java higher than 100%, openfire server not works. Nobody can connect or send messages. I tried to increase CPU Power but does not changed. – iravul Nov 03 '14 at 12:48
  • Okay. It is not at all clear from your question that you're having CPU spikes that are corresponding with inability to serve. When you start Openfire, does CPU instantly shoot up, or does it climb over a certain period? What happens if you start it but don't let clients connect? – chrylis -cautiouslyoptimistic- Nov 03 '14 at 12:50
  • You should connect to your JVM with VisualVM to see what's going on with the threads inside. You could also gain insight with simple thread dumps using `jstack`. – Marko Topolnik Nov 03 '14 at 12:53

1 Answers1

0

I know that this is an old thread, but just a couple of days ago I ran into a similar problem. The culprit was a mysql table ofOffline that had grown to 5 GB of data, after truncating data the server is operating normally.

jegorenkov
  • 153
  • 1
  • 5