Why are the servers always so overloaded, and how can we fix it?

General discussion of anything Starport related

Moderators: Moleman, Kwijibo, Luna

Post Reply
buggy
Posts: 45
Joined: Sat Aug 02, 2008 8:47 pm

Why are the servers always so overloaded, and how can we fix it?

Post by buggy » Tue Mar 20, 2018 3:11 pm

Note: I'm not blaming you or anything Toonces, I'm just curious about what causes the extreme server load and how we could fix it.

It seems like the forum servers are almost constantly overloaded, and while the ingame servers are fine they have issues if a significant number of people are in one universe at once. This wouldn't be that strange for a modern game on a cheaper server, but... Starport is fourteen years old and from what I can tell, it should not be a particularly server-intensive game either(see below).

If every single universe is run on a single, cheap server, as well as the forums and main website, then I suppose the lag might make sense. But it still strikes me as odd that the board is sometimes inaccessible due to server load, when there is absolutely no noticable lag ingame. You would think that the forums are such a small load that it wouldn't even be useful to block access to the forums. Disabling the search function makes more sense, as that can be significantly more resource-intensive but... how often are people searching? it's probably less than once per hour. And having the search function disabled for 95% of the day is less than ideal for a lot of reasons.



Looking at the game itself, I can't see anything that would be processor or memory intensive unless it has poor optimization. The main things that stick out as things that could but shouldn't cause lag are:
  • Stationary entities, eg turrets in space and on planets, and aliens. Serverside load for these with no player in the system/on a planet should be almost zero, load with a player should be small, and total load should be small. Could be a source of lag if all turrets are constantly searching for players and npcs, instead of using a active/inactive area system to determine if a player or npc could possibly activate a turret.
  • NPCs. Load should be... moderate-small. Their AI isn't terribly complex, but they do have collision detection and every single server has a fair amount of them, so if every npc is constantly active instead of simulating actions when a player is not nearby, this could be a fairly large source of lag.
  • Offline players. Load should be small, however since all offline players remain in the game world and still experience physics, this could be a rather large source of lag if there isn't any sort of system to detect a steady physical state and stop processing their ship's physics. if that's the case, and there are hundreds of characters on every server...
  • Colonies. These shouldn't be a issue but could potentially be depending on how they're handled. The colony simulation only iterates every 5 minutes or so, the calculations are simple, and the total information per colony is something like... 15 ints, 16 shorts, and two bools? There can be a thousand+ active colonies per server but if there's a average of 1 iteration per colony per 5 minutes you're still probably never going to see more than a dozen per second per server at worst. Still could be a issue depending on how its handled though.
  • Starports & other slow, long-term time-based systems. Things like starports regenerating/consuming resources, planets generating resources and aliens on their surface, and anything else I missed shouldn't, but could be a issue if handled improperly. If they use a timer system where every single one of these has a independent timer keeping track of how long its been since the last time they did whatever they need to, and every planet/starport does this, this could be a serious problem. The smart solution is to have planets/starports themselves be inert (only a stored XML or whatever other format Starport uses), and then once every few seconds, a random planet/starport is picked, the time since last update is measured and it's iterated as needed.

User avatar
Toonces
Site Admin
Posts: 1601
Joined: Mon Oct 04, 2004 10:23 am
Location: Beta Canum Venaticorum
Contact:

Re: Why are the servers always so overloaded, and how can we fix it?

Post by Toonces » Tue Apr 03, 2018 8:03 pm

Nice post! Looks like you are learning some good techniques in game programming. I didn't know that the servers seemed overloaded, though. They aren't sending me any error messages and the performance logs seem okay.

What's the symptom you are experiencing during game play that makes the servers seem overloaded (and which galaxy did it happen on)?

buggy
Posts: 45
Joined: Sat Aug 02, 2008 8:47 pm

Re: Why are the servers always so overloaded, and how can we fix it?

Post by buggy » Wed Apr 04, 2018 11:55 am

Well, most of the time there isn't a huge issue, but I get the impression that the servers are only just barely handling it.

Normal gameplay is fine with minimal lag, albeit with occasional fps lag which shouldn't be a thing, but that's a different issue. However, it seems that occasionally the server will suddenly start lagging quite a bit for a short period of time, and my best guess for this is that someone is invading and the projectiles are the issue. Also, I haven't seen it myself but people have said that larger numbers of players in a single galaxy can cause issues, and by large i mean going from ~10 to ~20. This is a surprisingly low number for any MMO, let alone a 10+ year old MMO.

Also, presumably to save money you're running the forums/main website on the same physical server as the game servers themselves, and the forums consistently report that they're overloaded. For instance, I just tried to use the search function while writing this, and got this message:
Sorry but you cannot use search at this time. The server has high load. Please try again later.
Sometimes, the forums also shut down completely for hours at a time with a similar message.

I'd guess I'm the only person who's on the forums right now, except maybe a search engine caching bot or something. If 1 person using your website causes enough strain that you have to start shutting parts of it down, you have a big problem.

User avatar
Toonces
Site Admin
Posts: 1601
Joined: Mon Oct 04, 2004 10:23 am
Location: Beta Canum Venaticorum
Contact:

Re: Why are the servers always so overloaded, and how can we fix it?

Post by Toonces » Tue Apr 17, 2018 7:22 pm

I'm not really worried about the forums performance and I think the search feature is just always disabled on this phpBB forums software. The error message says something about server load but that's nonsense, it's just a generic error message caused by the search feature not really existing at all.

I am concerned about the game server performance, though. When you say the server performance gets bad, what are the symptoms of it in terms of your game playing experience? Is there a lag time between requesting some action and seeing the results? Is it something with invading or ship-to-ship combat? Which servers is it happening the most on? How frequently does the server go into bad performance mode, is it like for a few minutes every 15 minutes?

Thanks.

Post Reply