httpPollSpeed and userdisconnects

Submit all your BlueBox related questions or report a bug here!

Moderators: Lapo, Bax

Vic
Posts: 32
Joined: 03 Sep 2009, 09:02
Location: Belgium

httpPollSpeed and userdisconnects

Postby Vic » 04 Feb 2010, 13:59

Hello,

I connect through bluebox and have a pollspeed set of 250.
I'm playing an easy game like Solitaire.
During gameplay I only send events to the SFS and don't send anything back, only the score at the end of the game.

is following situation possible...

If my pollspeed is 250, I make 4 requests per second. But that doesn't happen all the time right?
Sometimes I see players filling up there Q with a value of >100
Which is strange because the queuesize is default 120 and maxDroppedPackets is 20, that user should already be disconnected.
Image

I assume that Q in the above image is the outgoing queue displayed in following image. Is that correct?
Image

Now the question :-), is it possible that for slow connections, the httpPollspeed is too high and causes dropped packets which results in a user disconnect, with the knowledge I only send the score back at the end of the game and during the game nothing. The action that can be send the most is "deck" that's when a user clicks the deck as fast as possible to receive new cards. (that's not normal behavior, but still :-) )

8)

some insights would be great

many thanks

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

Postby Lapo » 04 Feb 2010, 15:16

Hi, no most of those assumptions are incorrect.
If my pollspeed is 250, I make 4 requests per second. But that doesn't happen all the time right?

Not exactly. The polling used by the BlueBox works in a different way. The http connection is held by the server until there is some data to return.
The connection is held for a max of 20 seconds then it's released and a new poll is fired by the client.
If at any time some data is available for the client the BlueBox immediately releases the connection returning a response. This way a response is quicker than waiting the next poll cycle.
Once the connection is returned a new poll is sent to the BlueBox after XX milliseconds, where XX in this case == 250ms.

In case of continuos updates from the server each response will be separated by an interval of 250ms while "normal polling" is unable to operate reliably at speeds below 1000ms.

I assume that Q in the above image is the outgoing queue displayed in following image. Is that correct?

Nope.
The queue that you see in the BlueBox monitor is not the SmartFoxServer User queue. That's the BlueBox queue for that tunneled connection.

Finally, given the scenario you are describing using a poll of 250ms won't change the performance very much. Lower settings such as this are only effective where you have continuous updates from the server like in an action game.

is it possible that for slow connections, the httpPollspeed is too high and causes dropped packets which results in a user disconnect, with the knowledge I only send the score back at the end of the game and during the game nothing.

No, for the reasons I have just explained.
If the server has nothing to return to the user the polling times will be very slow, as I said one every 20 seconds. So the HTTP server will sleep golden dreams :)

One thing I need to recommend is to make sure that clients use the latest API provided with SmartFoxServer 1.6.8 update, and of course the BlueBox should be the latest 1.0.5
Lapo
--
gotoAndPlay()
...addicted to flash games
Vic
Posts: 32
Joined: 03 Sep 2009, 09:02
Location: Belgium

Postby Vic » 04 Feb 2010, 15:50

Ok, thank you, now I understand why it sometimes takes 20 seconds before I get a response (debugging with firebug ;-) )

Now, what's failing then, what's a dropped packet? For each game I only make 10 ping requests and send the score back... and the queue only gets filled up with responses coming from sfs, right? (cf. image)
Are those failed httppoll requests during gameplay? Or am I totally wrong?

I know it's due one of the following reasons:
    Bad or slow client connection
    Too much data being sent too frequently
    Lack of bandwidth on the server side

thanks for your time

I'm working with the latest API already ;-)

regards
Vic
User avatar
Lapo
Site Admin
Posts: 21228
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 04 Feb 2010, 15:57

From your picture it seems that only one client has problems, the one with 130+ messages. That is probably a client who got disconnected/closed the browser or something like that.
The BlueBox however needs some time of interrupted communication before deciding if the client is really gone. In your case this is 60 seconds, probably too high, I would stick with 30.
Are those failed httppoll requests during gameplay? Or am I totally wrong?

I don't understand, you mean what are the 132 items in the queue?
Those are server messages which wait to be delivered to the client, but the client is not calling the BlueBox anymore so they stay in the queue.
As I said, the BB will wait for the configured time and if the client doesn't give signs that he's alive he will be shut down.

hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
Vic
Posts: 32
Joined: 03 Sep 2009, 09:02
Location: Belgium

Postby Vic » 04 Feb 2010, 16:29

Those are server messages which wait to be delivered to the client, but the client is not calling the BlueBox anymore so they stay in the queue.


So if there's no communication from my side with the client, there are still some default server messages...? Because most of the time I don't send anything back.[/quote]
User avatar
Lapo
Site Admin
Posts: 21228
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 04 Feb 2010, 17:05

The server fires events for rooms created/destroyed, user count updates and such. Anyways you can capture the whole session from the Flash IDE or Flex by turning on the debug flag of the SmartFoxClient instance.
This will allow you to better understand which messages are being exchanged.

If there's any specific issue you need to investigate let us know, including one of these transcripts as well
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “BlueBox”

Who is online

Users browsing this forum: No registered users and 1 guest