Connections persistent

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
Annecy
Posts: 9
Joined: 29 Mar 2005, 12:46

Connections persistent

Post by Annecy »

I have 2 games using SmartfoxLite. I have 500 to 1000 differents players for one day and a maximum of 20 to 30 users at the same time. On the firewall (which include a trafic analyser) installed on the server I see that every day 5 to 10 TCP connections to smartfox stay open. (for smartfox those users are removed). Those connections are never closed (even after one week). I must restart Smartfox to close them. Is it due to client web browser unclosed or something else ?

Michel
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Do you use the <MaxUserIdleTime> setting?
Did you try to set it to a value like 600? (10 minutes ) This way idle connections should be killed after that range of time.

Another thing: when your firewall traffic analyzer shows those "ghost" connections try checking them also with netstat (netstat -an) and see if they are in "ESTABLISHED" status or not.
Lapo
--
gotoAndPlay()
...addicted to flash games
Annecy
Posts: 9
Joined: 29 Mar 2005, 12:46

Post by Annecy »

The MaxUserIdleTime is set to 900 (15 mn).

With netstat all the connections are also seen Established.

In fact when the MaxUserIdleTime expired, the user is removed, the TCP connection is closed by smartfox and a new connection from the same IP address with a port different is open automatically because the browser of the player is still open. Those connections might be close when the player close his browser.

So I concluded that some people stay connected to Internet and let there browser open during few days without interruption. Am I right ?

Michel
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Yes that is possible.
There are a few things I can say to make things clearer:

1) When you just send the connect() command to the server you establish a connection but you're not yet recognized as "real" user in the server. You become a user once you have successfully logged in a zone.

At the moment the Admin tool shows only users, not connections.

2) There's a very well known bug of the flash player when used inside a browser. Sometimes when a user disconnects from an XMLSocket the connections is not really killed and you remain connected until all browser windows are closed. We've seen this behaviour not very often but it can happen and it took us some time before we understood what was going on.

A solution to this is setting the MaxUserIdleTime to a lower value, like 3-5 minutes, so all useless connections are killed at a faster pace.

:)
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply