(Please do not post anything about bashing the server, that is not the point of this thread.) IIRC I heard that the current source was the cause of all these laggs we have had the past 4+ weeks but what always got me thinking was... How did the current source always be stable untill recently? Ive tried to think of reasons why this happened and eventually came up with 2 for now which are : 1. The obvious one, the playerbase raised alot for a few weeks ago and the server cant handle it. 2. The playerbase cap is too high? (referring to this thread : http://royals.ms/forum/threads/500-players-online.24486/) Now the 2nd one is intersting since I dont remember exactly when Royals started to get all these laggs but since the servers have been lagging for so long, maybe it is connected with the 2k playercap update? If so, why not decrease it to 1k? Since I havent tracked the playerbase population over a 24h period in a weekend so im not sure how far the playerbase has raised, but if its only at 600-700, would that really be the reason why the server would start lagging? If the reason is that the reason of all this lagg is because of the current source, then why would the lagg appear just for a few weeks ago when Royals has been up for months without laggs? (I cant tell if the server didnt have laggs before I started since I did not play before that, but the servers where probaly stable back then aswell.) What do you guys think? Is there another cause that makes Royals laggy? Discuss! Share your thoughts & opinions!
Well there has been problem like during December event, when hundreds of players changes channel that crashes the source. When everybody used skills during the event a lot of dc's happened. Now there is so much more stores causing major dc's, more players changing channels at the same time. We got a major improvement with the slime boss where there were practically no dc's besides the start of it, but then I guess the massive player increase caused too much overload.
The lag problems aren't just a recent thing either, they've happened before in the past, noticeably last summer, when there are population spikes. Those problems were dealt with by some temporary fixes, but the underlying problem is the inefficient source code. Basically when the population spikes the source can't keep up with the increased server activity and slows down to try to keep up causing the lag. (I'm no dev so that's just my understanding of how it works.)
A larger player base means that the database tables used to store data about items/players/accounts become bigger and bigger. Then, every query and request to those databases/servers take longer because each table is bigger and takes longer time to search through. This is especially true if the database tables are inefficiently designed without the appropriate keys. In a sense, every time you make a new character, you are contributing to server lag, albeit small. Also, lowering the player cap from 2k->1k would probably do nothing.
I obviously haven't looked at maplestory's source, but I doubt it's this. I would be extremely surprised if maplestory was using a BST or something with O(logN)/O(N) when they could just use a hash table, as accessing the hashtable would be O(1).
So when the server is temporarily frozen, one of the staff members has to notify an admin who looks at all the queries the server is running and we normally find that for whatever reason, when an item is being saved by some character, that query gets stuck and forms a bottleneck for the rest of the server. As soon as we tell the DB server to stop executing that query, the frozenness thaws and the server returns to normal. The whole inventory system was redesigned by Gi last summer and while I don't want to point fingers, there's the possibility inefficiency exists in that code which is contributing to the issue. In terms of the lag itself, as others have said, plain and simple, the code as a whole is inefficient. In order to prevent rollbacks that were happening, we have your character saved when you do pretty much anything (CC, login, logoff, etc). The same goes with hired merchants. In order to prevent dupes and loss of mesos/items, every time you open and close your merchant, your ENTIRE merchant (not just the item that was added/removed/purchased) is resaved into the DB. The number of queries for just one character is probably in the couple dozen. Now multiply that by the several hundred characters on at any given time, and factor in the large size of the DB (several gigabytes), and you have issues. Let's add on top of that that there exists memory leaks in the code. I'm not going to describe memory leaks as a quick Google search will explain what they are, how they work, how they occur, but that is why after several days of uptime, the server needs a SC to restart itself, clean out memory, and start fresh. Tl;dr the original code wasn't the best, we made many modifications to it over the past 2 years, the server has exploded in size over two years. Add that all together and you have the issues that we typically see.
Based on your statements, it sounds like you're taking a Data Structures and Algorithms class of some sort. Please don't try and confuse everyone, because as you said, you don't really know what's going on. A BST would not be used in MySQL. Also, hash tables would not be used for the amount of data that is needed to be stored for a server like MapleStory.
That is top quality hardware to run a Maple Story server. With this server im wondering if you are you running an esxi to separate the game server from the apache ?