[guide]howto fix some crashes

07/28/2011 14:51 RoflcopterGoesSoiSoiSoi#16
Locks are the result of a stored procedure placing a lock on the data to prevent changes while the procedure is querying or updating the row. The cause of these locks is a design flaw in the coding itself. I'm not sure why it is the way it is, nFlavor must have used these files in some sort of working server at some point or another.

A deadlock happens when the SQL server enters an endless loop of requesting locked data and not being able to unlock (release) it. The gameserver crashes whenever it encounters this error.

Quote:
SHARED - This lock is applied for read operation where the data is not updated. A good example would be the select statement.

UPDATE – This locked on those resources that can be updated. This lock prevents the common form of dead lock that occurs when multiple sessions are locking the data so that they can update it later.


EXCLUSIVE - Used for data-modification operations, such as INSERT, UPDATE, or DELETE. Ensures that multiple updates cannot be made to the same resource at the same time.

INTENT - Used to establish a lock hierarchy. The different types of intent locks are: intent shared, intent exclusive, and shared with intent exclusive.

SCHEMA - Used when an operation dependent on the schema of a table is executing. The different types of schema locks are: schema modification and schema stability.

BULK UPDATE – This lock is applied when there is a bulk copying of data and the TABLOCK is applied

KEY RANGE - Protects the range of rows read by a query when using the serializable transaction isolation level. Ensures that other transactions cannot insert rows that would qualify for the queries of the serializable transaction if the queries were run again.

-- [Only registered and activated users can see links. Click Here To Register...]
I'm sick of providing support for this via MSN/PM. Do not contact me any more. You have the cause and a small explanation, you can fix it yourself.
07/28/2011 15:05 ismokedrow#17
There could be a rather small amount of issues that can cause your server to lock up periodically. There is a series of questions you should ask yourself.

Is the crash triggered via an In-Game Action?
(This is why having a smaller testing crew is normally more beneficial)

Did I check the GameLog.Txt for an Error?
(Most of all Errors dealing with connections will be placed here.)

Am I hosting Aurora/Herlock and DB's on the same pc?
(Believe it or not your configuration of AS/GS/DB's can make or break your server)

Are my DB's hosted by a computer with a slower Read/Write speed?
(As the DB's need constant access to the hard drive, to R/W information, the a slow hard drive can easily be the culprit 'lag' in game.)

What may be some things you can try:

-Make sure the DB's are hosted on computer with an at-least modern HDD.
-- Host the DB's on a separate computer (HDD needs a moderately fast R/W too.)
-- Hosting with Split Configuration requires you to Port Forward but can often time dramatically reduce network lag.
-Google Nagles Algorithm
-Use a TCP optimizer which can be found at SpeedGuide.net

Why does Nagles Algorithm even matter?

TCP by default is one of the most stable network protocols. After it sends out a packet (e.g. Server to Client) it has a built in fail safe that waits for a ACK or a packet sent back by the client saying "HEY WE GOT IT"

Now this in itself can cause short delays and lag-spikes, but Nagles Algorithm was another fail-safe. Where normally tiny packets would fire of instantly for small things in-game like (movement, picking up an item, the weather changing...) with Nagles Algorithm on the server waits and gathers many of these small packets together before transmission. (MMO's expect these transmissions to be instant.) which can cause large stuttering and lag delays (often with the DB too.)

How can you tell if your PC is too slow to effectively host a Database?

1. If your computer often hangs/lags or entirely freezes when loading Sql Server Management Studio.

2. If your computer often hangs/lags or entirely freezes while navigating the Database via SSMS.
07/28/2011 15:08 RoflcopterGoesSoiSoiSoi#18
it should be noted that it's entirely normal for the server to take a while to respond when requesting large sets of records, connecting to a remote server or making the first initial connection~
07/28/2011 16:36 Uebari#19
Quote:
Originally Posted by s0ul37 View Post
I tried removing/disabling the Auction House and the Level Up Manager - but still - my server crashes in reason of "Transaction Error: Lock blabla something with lock logging".

I used this line in game.opt S game.bUseLockLogging:0 and it seemed to work for 2 hour but afterwards it started crashing. The only thing that could cause these crashes are 'i think' either the already optained items of the level up assistant or the hidden village buffs - as they get an error sometimes when buffing.
Many of the SMP Procedures have to be modified, as I did to fix the errors... You should be getting SMP issues such as smp.update_item_owner, smp.update_item, smp.update_character and so on and so forth
07/28/2011 16:58 s0ul37#20
Interesting, that's very useful info, thanks to all.
07/28/2011 19:20 Uebari#21
Quote:
Originally Posted by ironhammer500 View Post
Theres also a ton of dupitcated ids and item and omg tons and tons of crap in the dbs...nflavour didnt bother removing their crap lol
Well it's simply if you can't fix it don't bother running a server.