Forum Multiplayer Insane Webservice Traffic

Discussion and help relating to the PlayerIO Multiplayer API.

Insane Webservice Traffic

Postby hyperion51 » July 3rd, 2017, 3:35 pm

I'm working on Aetheria, a space-themed multiplayer third person arena shooter with gravity mechanics. Here's a build. I'm currently only using PlayerIO to serve a level generated on the server and synchronize players and projectiles, so 65.37 MB Data received vs 24.33 MB Data sent makes sense. However, my webservice traffic is 1.54 GB, which is completely out of proportion.

I've looked at other posts about high webservice traffic, and usually that seems to be DB usage. Since I'm not using the DB yet, what could it be? I saw mention of using the API Sampler, which I will try during my next test, but I'm afraid to send my alpha out to more people if just 4 players testing in one night can cause this.
hyperion51
 
Posts: 17
Joined: June 29th, 2017, 3:52 pm

Re: Insane Webservice Traffic

Postby hyperion51 » July 3rd, 2017, 3:37 pm

I should mention that both the game and server code were derived from the Unity Mushrooms Example.
hyperion51
 
Posts: 17
Joined: June 29th, 2017, 3:52 pm

Re: Insane Webservice Traffic

Postby hyperion51 » July 3rd, 2017, 5:34 pm

Just tested some more. API Sampler doesn't seem to be able to get any samples at all, but webservice still seems sky-high
hyperion51
 
Posts: 17
Joined: June 29th, 2017, 3:52 pm

Re: Insane Webservice Traffic

Postby Henrik » July 6th, 2017, 12:42 am

Multiplication generates large numbers, fast. :-)

Where's the 65MB data received and 24MB data sent from?

In the PlayerInsight section of the control panel, you can go to the ResourceUsage tab. That contains a bit more underlying numbers and statistics that can show you where your traffic is coming from.

Other things to think about is what happens when someone reloads the game client? How much data is sent out every time that happens?
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Insane Webservice Traffic

Postby hyperion51 » July 6th, 2017, 1:07 pm

The reasonable numbers, now 85MB and 30MB, are what the multiplayer received from client on server, and sent to client from server. This is my code, I sent those messages and I have control over that.

The ridiculous usages are 897.89 MB "received in the Webservice", 113.02 MB "Sent from the Webservice", 865.21 MB "sent to the Webservice from the Multiplayer" and 140.49 MB "received from the Webservice to the Multiplayer". Apparently this amounts to 1.97 GB currently.

Let me get this straight. I didn't ask the SDK to stream ridiculous amounts of data to your webservice for god only knows what reason. And yet not only are you counting the usage towards MY 20GB limit, you're counting it *twice*. Since my code is derived from your own example code, it would be extra ridiculous if you told me I'm not connecting properly.

I programmed the messages. The messages are fine. These are actions your SDK is taking without me. The usage definitely should not be counted because I have no control over it. It certainly should not be counted double (you count the bytes both when you send them to yourselves and receive them from yourselves).

I can't make a game like this. Not to mention I'm unable to see changes made to connections in the dashboard, but that's a separate issue.

I like the idea of being able to host everything for my game in one place, but at this rate I can't afford not to start writing Photon integration just in case none of this gets resolved. And your reply was not super encouraging.
hyperion51
 
Posts: 17
Joined: June 29th, 2017, 3:52 pm

Re: Insane Webservice Traffic

Postby Benedani » July 8th, 2017, 5:09 pm

Check your error log, might write lots of errors to the error log which means a lot of webservice traffic, however that wouldn't make sense in your scenario where it's a lot RECEIVED. Do you constantly make a lot of rooms or something? Do you use BigDB a lot? If not, can I have the source of serverside so I can look at it (pm)?
Benedani
 
Posts: 12
Joined: March 28th, 2017, 5:10 pm

Re: Insane Webservice Traffic

Postby hyperion51 » July 8th, 2017, 7:23 pm

Here's my server code. As I said earlier, there's not much there. I just started with the server code for the Mushrooms example and altered/added messages to fit my game. Therefore I don't mind sharing it publicly.

Thanks for mentioning the server error log, I wasn't aware of that dashboard page. If I was, I'd have done something about the thousands of "given key was not present in the dictionary" errors that apparently started appearing since I added projectile sync in v13. I'll have to redo the projectile code anyway as currently the clients are responsible for killing any bullets they spawn, and that's unsafe (what if someone fires a bullet and then disconnects?). But could that cause such a spike?

I'm looking closely at the historical data now, and this does appear to be when the problem started. On Friday and Saturday I had 164 and 131 API requests, respectively. On Sunday, when I added projectile sync, I had 438,804 API requests, and 610MB of API traffic. This has to be direct evidence of the problem, right?

As to your other questions, I'm not using BigDB yet. Testing does cause a lot of rooms to be opened and closed (150x last weekend), but while I expect slightly elevated usage there, it shouldn't bankrupt my data cap this way, right?
hyperion51
 
Posts: 17
Joined: June 29th, 2017, 3:52 pm

Re: Insane Webservice Traffic

Postby Benedani » July 8th, 2017, 7:38 pm

Well, makes sense. One thing I could suggest (considering the code runs correctly in other cases) is use try catch, which avoids writing to the error log (but also does not give you any error information). However, read traffic does not make sense. Well, if you do that, you'll clearly slice off the write part at least, and we're one step ahead. I'll look at your server code.
Edit: Couldn't find anything related to massive read. So I guess it's errorlog then. Somebody explain to me how does writing to errorlog cause read traffic?
Also, somebody told me that the 20gb data cap is more like RAM, not the actual data history. He is apparently using free plan on a game which has more than 20gb data in the last month. I dunno what he meant by that, but I guess it's not much of a problem.
Benedani
 
Posts: 12
Joined: March 28th, 2017, 5:10 pm

Re: Insane Webservice Traffic

Postby Henrik » July 10th, 2017, 7:37 pm

Hey Hyperion,

For the historic data, we only store the total amount of webservice requests per day, and if they came from the game client or the game server. We break out a few webservice operations that are the usual suspects for large amounts of data, i.e. bigdb operations, but we don't store a historic counter for every game for every day for every single webservice method, so I can only tell you the same numbers that you are seeing in your control panel.

And as you found, there were 438k webservice requests one day while you were developing your game and testing, but you changed something so it stopped doing that a few days later.

We have the API sampler tool to figure out the exact mix of requests, but it's a live tool, so to figure out what happened, you have to revert to that version of your gamecode, do what you did that day in your game, and then start sampling so you can see exactly which requests the game server is sending.


As Benedani mentioned, you have an error log, and every time your serverside code throws an exception, the server catches it and logs it to your error log. Trust us, you want this behaviour, because you really don't want uncaught exceptions in your serverside code.

I noticed you have a lot of errors in your error log for those dates, so I'm pretty sure that logging all those errors are the source of the traffic. You're still way below the limits of the free plan, and you caught the error in time, so everything looks like it's working like it should!
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to Multiplayer



cron