Do you need IPv6 for Openfire or did you already disable it? It would help a lot to know whether IPv6 is also the cause for the issues you have.
I donāt know need IPv6 support right now.
Not much of a Java wiz, where/how exactly do you set -Djava.net.preferIPv4Stack=true ?
Default location is /etc/sysconfig - openfire file. Inside this file i have uncommented line:
If you wish to set any specific options to pass to the JVM, you can
set them with the following variable.
OPENFIRE_OPTS="-Djava.net.preferIPv4Stack=true"
service openfire restart
required.
Hrm. Probably should have mentioned that Iām on OS X, so not gonna find that file there.
Iāll poke around, but itād be nice if it gets fixed in, oh say, 3.11.
For Debian-type systems (including Ubuntu), add it to the DAEMON_OPTS variable in /etc/default/openfire.
OS X doesnāt use /etc/default or /etc/sysconfig. You can try adding the flag to the java command line in /usr/local/openfire/bin/extra/openfire-launchd-wrapper.sh, like this:
/usr/bin/java -server -jar "$OPENFIRE_HOME/lib/startup.jar" -Dopenfire.lib.dir=/usr/local/openfire/lib *-Djava.net.preferIPv4Stack=true* &
The tarball doesnāt add an initscript-- If you havenāt cobbled one together youself, you may try adding the command line option in ./openfire/bin/openfire
Adding OPENFIRE_OPTS="-Djava.net.preferIPv4Stack=true"in /etc/sysconfig/openfire helped. CPU usage is back to normal. Thanks, FOI!
Yep, same issues here, actually my cpu was hitting 120%
The fix outline above worked perfectly, thank you tons!!!
I spoke to soon. This morning Java CPU usage is nearly 100% again.]
Just to confirm, this is what is in the /etc/sysconfig/openfire file
If you wish to set any specific options to pass to the JVM, you can
set them with the following variable.
#OPENFIRE_OPTS="-Xmx1024m"
OPENFIRE_OPTS="-Djava.net.preferIPv4Stack=true"
Ryan,
Are you able to verify, via the command line that this flag is actually being set on the openfire process?
I havenāt, but I can. How do I check to verify?
The āps axā commandā¦ and a really wide terminal window.
Looks like I am indeed passing that option in the config.
[root@im ~]# ps aux | grep openfire
root 8101 0.0 0.0 5132 672 pts/0 S+ 10:53 0:00 grep openfire
daemon 30564 377 11.5 1296912 478564 ? Sl Apr27 3113:34 /opt/openfire/jre/bin/java -server -Djava.net.preferIPv4Stack=true -DopenfireHome=/opt/openfire -Dopenfire.lib.dir=/opt/openfire/lib -classpath /opt/openfire/lib/startup.jar -jar /opt/openfire/lib/startup.jar
Iām also seeing the above behavior. CPU usage reaches 100% after an hour or two. Openfire still responds as expected. Once CPU hits 200%, Openfire stops responding and the service must be restarted. This takes anywhere from 1 to 12 hours.
Iāve added the IPv4 setting as shown here:
[root@community openfire]# ps -ef | grep java
daemon 7710 1 4 Apr27 ? 00:50:22 /opt/openfire/jre/bin/java -Djava.net.preferIPv4Stack=true -server -DopenfireHome=/opt/openfire -Dopenfire.lib.dir=/opt/openfire/lib -classpath /opt/openfire/lib/startup.jar -jar /opt/openfire/lib/startup.jar
Attached are the relevant files.
warn.log.zip (2895 Bytes)
nohup.out.zip (7161 Bytes)
error.log.zip (7877 Bytes)
Hi, been posting in the other thread 3.10 200% CPU
What I have tried
set OPENFIRE_OPTS="-Djava.net.preferIPv4Stack=true" to /etc/default/openfire
Updated to the latest linux-image-rpi2 (I am running a raspberry pi 2 in ubuntu)
restarted
Still get the 100% to 200% or more CPU usage after a period of time (it could be a few hours to a day)
I did not have this issue with openfire 3.9.3 with java 7
Hope this helps in solving this issue
6 days ok. Now is 100% again.
Yep, Iām rescinding my earlier comment. I actually hit over 500%.
Switched back to 3.10 Beta of 3-24-2015ā¦all is well again.
I also tried the ājava.net.preferIPv4Stack=trueā fix. Before doing that, openfire would peg the CPU in a matter of 4-6 hours. After disabling IPv6, itās more stable, but the behavior has returned after over a day of uptime.
Same issue here. Enabled the IPv4 fix, still breaks with Java CPU spiking.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
14751 daemon 18 0 1234m 538m 10m S 98.9 13.6 35:02.65 java
Here is our nohup.out after sudo kill -3
Phil - Where can I get that beta? Iād love to try it. Weāve actually had this issue since 3.9.3 so weāre stuck on OpenFire 3.8.2 for now.