powered by Jive Software

Lots and lots of open connections?

I’m not entirely sure if I’m using this program/information correctly, but, after running OpenFire 3.4.5 for probably a week or two without restarting, lots of stuff on my FreeBSD 6.2 system start slowing down a bit. I was looking around for open files, stumbled upon the fstat command, and gave it a cursory wc -l to see how many entries there were. I had about 41k rows in the output. I checked again and 39k of those are the java process on the box running OpenFire. Just about all of those rows were of the type “internet stream tcp”, so I’m assuming it’s some sort of network connection/socket that’s open. At the time I had about 75 users online, around 80 or so active IM transport accounts, and perhaps 10 or 20 s2s connections. I also confirmed these active connections with netstat.

Anyway, as an experiment, I killed the server just a few minutes ago and checked the fstat output again. It dropped down to about 1.5k entries, which seem reasonable for a general purpose server with several web clients. When I restared OpenFire, and began checking the fstat output all along the way, it seemed to start with only 80 open files. A few seconds later, 150. Then 300. Then 1500. And so on and so forth, up and up, seemingly without end. They do fluctuate just a little bit, but after the server has been running for approximately 10 minutes, I’m at 11.7k open files all belonging to the java process running OpenFire. About half of those are the “internet stream tcp” type, wth the rest mostly being pipes.

Is this normal, or is this unusual? I think fstat on FreeBSD is similar to lsof on other systems, basically giving you a list of open files (which includes devices and such in the *nix world, of course). It just seems tremendously excessive at first glance. Could anyone happen to provide a little insight, and if it’s a bug, a nice fix? Thank you!

Oh, system info:

FreeBSD 6.2

OpenFire 3.4.5

Sun JRE 1.5.0_07

PostgreSQL 8.2.5 back-end


What version of the IM Gateway plugin do you have installed? One of the older versions had a bug where the MSN support was oozing open file handles.

Oops, forgot to put that in there. I have version 1.2.2a.


Hi Allie,

so it looks to be an IM gateway problem, my Openfire 3.5.0_b2/Linux server has only a few TCP sockets open. And I’m not running the IM gateway.

You could try to restart the Gateway plugin instead of restarting the server, not sure if this helps.


After reading this message this morning, I checked the current level of TCP streams with fstat (32k) and restarted the IM gateway. It dropped to 16k as it reloaded, and then went back up pretty high. So the IM gateway may be related, but, it also opens/uses several connections per user anyway. Plus, I’m not sure why there are so many still open after it’s been restarted (even though it’s substantially lower).

I’m still not entirely sure what these files/streams are, since a check with netstat shows only a handful of open connections. It’s confusing, but frustrating.