Possible workaround for users experiencing high cpu or memory under linux

I’ve noticed some users have posted that they are having problems with openfire under linux. It seems that most have been under debian/ubuntu.

Before I get started, I should let you know that I’m a windows guy, and a complete linux nube!

The issue appears to be that after a few hours or days, the server would stop accepting connections, cpu or memory will be maxed. This would require the server (or process) to be restarted.

I finally set up a test server. I may have reproduce the issue, and after some research and testing, I believe I have a workaround.

I was able to regain stability by tuning malloc. I set the environment variable MALLOC_ARENA_MAX=4. From my research 1,2,4 are all good places to start, with 4 being the most recommended.

test at your own risk!

I would like feeback from the linux gurus!

tested with

ubuntu 14.04.3 lts (vmware virtual server)

1 vcpu

2gb ram

oracle java 8u60 x64

openfire 3.10.2 deb install package

stresstest script with 3k concurrent connections.

1 Like

If more users confirm this workaround working, we can add this to documentation.

Thanks for this tip. I’ve been having the same issue with centos 6.5 and OF 3.10.2

It always seems to manifest itself towards the end of the day as people start to shut down their workstations

I have set this environmental variable and I will keep you posted

great. look forward to hearing about your results.

I’ve been keeping an eye on this. There does appear to be an improvement but I am still getting the CPU spikes. But they are happening more out of hours now so not such an impact to my users

Recently upgraded to 3.10.3 and have not had the issue I’ve been monitoring the server packets and CPU usage by java and I’ve not had the repeat issue of the high cpu. I’ve just taken the step to disable my overnight restart to see if this is now non longer needed.

I was doing the overnight reboot to clear resources as a measure to combat this issue

So, the issue is not on CentOS or Linux AMI? and no need to add the environment variable?