Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High update diff on MapMgr #1402

Open
Undergarun opened this issue Sep 6, 2013 · 34 comments
Open

High update diff on MapMgr #1402

Undergarun opened this issue Sep 6, 2013 · 34 comments
Labels

Comments

@Undergarun
Copy link
Member

Since couple of weeks ago, i notice a MapMgr load some ticks good 50-200ms and others significantly high, 400 - 700 ms. Is possible any improvement to speedup something on MapMgr to avoid "server delay"?

P.D: vmap.Dynamic.DoubleCheck = 0 and 1000 ppl

@rsa
Copy link
Member

rsa commented Sep 6, 2013

this long time, or some time ago? don't remember any big changes for CPU use last year...

@rsa
Copy link
Member

rsa commented Sep 6, 2013

PS what your visibility radiuses in config?

@Undergarun
Copy link
Member Author

3-4 weeks ago. But now more players than month ago, so source possible older.

Visibility.GroupMode = 0
Visibility.Distance.Continents = 90
Visibility.Distance.Instances = 400
Visibility.Distance.BGArenas = 180
Visibility.Distance.InFlight = 100
Visibility.Distance.Grey.Unit = 1
Visibility.Distance.Grey.Object = 10
Visibility.RelocationLowerLimit = 10
Visibility.AIRelocationNotifyDelay = 1000

@rsa
Copy link
Member

rsa commented Sep 6, 2013

may be new mmap quality? try disable.

@Undergarun
Copy link
Member Author

How? Disabling whole mmaps?

@rsa
Copy link
Member

rsa commented Sep 6, 2013

no, tempdelete mmap files from one map (with max lags) and see on result.

@Undergarun
Copy link
Member Author

Mmmmm seems to be related to Spell System. Getting back MaxSpellCastInChain to 25 seems to decrease load significatly, so possible some spells with endless trigger castings. U.u

@rsa
Copy link
Member

rsa commented Sep 7, 2013

possible... need string with this limitation from your logs.

@Undergarun
Copy link
Member Author

Getting back to mmaps checks, still high MapMgr with high population. Is not the same adding maps ids to mmap.ignoreMapIds config param than delete mmap files from folder?

@rsa
Copy link
Member

rsa commented Sep 9, 2013

same,but not requires config reload.

@Undergarun
Copy link
Member Author

Confirmed, mmaps issue. Good performance with mmaps = 0

@rsa
Copy link
Member

rsa commented Sep 12, 2013

mmaps requires many CPU time as intenended. possible solution - 1. lower MMAP quality (as before last changes) 2. increase the parallelization of the processing (currently i'm try this).

rsa added a commit that referenced this issue Sep 12, 2013
…ept VMSS), add templated class for possibility continue parallilize tasks. testing (no any changes must be currently). need check compile under win.

related to #1402 and some more old.
@mns
Copy link

mns commented Sep 12, 2013

MTMMAP :D

rsa added a commit that referenced this issue Sep 12, 2013
…sibility continue parallilize tasks. testing (no any changes must be currently). need check compile under win. Ready for testing.

related to #1402 and some more old.
rsa added a commit that referenced this issue Sep 14, 2013
…ossibility continue parallilize tasks. testing (no any changes must be currently). need check compile under win. Ready for testing.

related to #1402 and some more old.
rsa added a commit that referenced this issue Sep 14, 2013
…ossibility continue parallilize tasks. testing (no any changes must be currently). need check compile under win. Ready for testing.

related to #1402 and some more old.
- also some rework in VMSS (to be continued)
- statistic passed to template (hooks)
rsa added a commit that referenced this issue Sep 15, 2013
…ossibility continue parallilize tasks. testing (no any changes must be currently). need check compile under win. Ready for testing.

related to #1402 and some more old.
- also some rework in VMSS (to be continued)
- statistic passed to template (hooks)
@Undergarun
Copy link
Member Author

Seems as without mmaps load decreased (Obviously, less cpu resources needed) but still high update diff in MapMgr, so possible not related to changes in mmaps. Let's continue with work on paralelizing but please, check cause on other possible places.

Thank you!

@Undergarun
Copy link
Member Author

Does "SoftIRQ" indicate high locking?

See this:

softirq

leyend

Dedicated R2 machine. No MySQL or any other software running then OS. Whole activity comes from R2 runtime.

MapUpdate.Threads = 10
MapUpdate.DynamicThreadsCount = 1
VMSS.Enable = 0

@rsa
Copy link
Member

rsa commented Sep 17, 2013

no. "softIRQ" not related to user task (like mangos) always, and indicate very high rate of IO operations, maked by kernel. this - file IO, network IO.
need make some file operations (like logging, vmaps/mmaps reading) asynchronous...
very good diagram. optimal CPU load.

rsa added a commit that referenced this issue Sep 19, 2013
…ass for possibility continue parallilize tasks (no any changes must be currently). need check compile under win. related to #1402 and some more old. - also some rework in VMSS (to be continued) - statistic passed to template (hooks)
@Undergarun
Copy link
Member Author

Without [mr2958] ab430e0, [mr2959] 366282a, [mr2960] f372ae0, [mr2956] 4e83d6e

Some crashes:

In Map::SendObjectUpdates: http://pastebin.com/uLaM3B5c

In Map::FindObject: http://pastebin.com/mBjEC2QD

@rsa
Copy link
Member

rsa commented Sep 20, 2013

first - please, point me to src/game/Map.cpp:2219 in your source,
second - in 2962

@Undergarun
Copy link
Member Author

            obj->BuildUpdateData(update_players); in void Map::SendObjectUpdates()

@Undergarun
Copy link
Member Author

Till [mr2957] stable. Singleton locks seems to cause freezes. MapPersistentSate cycle test in progress.

@rsa
Copy link
Member

rsa commented Sep 21, 2013

use singleton locks instead of manual not must cause any freezes (in theory :). but this may identify weaknesses in the code

@Undergarun
Copy link
Member Author

Please, check possible weaknesses. If MapPersistentState changes stable, i'll continue testing with "Null locking in ObjectAccessor" and then back to singleton locks.

"lock in BuildObjectUpdates" also under testing, hopefully no issues here, and other crash fixed.

Thank you.

@Undergarun
Copy link
Member Author

Notice weird behaviour, more players == stable. Less players == unstable. I'm having crashes from 9:00 am to 15:00 pm and then nothing... if server crash during stable period, it'll be crashing till next load peak.

@Undergarun
Copy link
Member Author

@rsa
Copy link
Member

rsa commented Sep 25, 2013

VMSS make output in regular logfile. first dump - normal crush (must be correct handled by VMSS), second - broken (no point for search).

@Undergarun
Copy link
Member Author

Possible source of HighUpdateDiff on MapMgr in:

SpellCastResult Spell::CheckCast(bool strict) caused by taking too long grid searchers due to "[mr2858] Fix searching for nearest creatures/gameobjects".

This the last possible source since is not a mmaps issue and not MaxSpellCastInChain. I revert this commit and i'll be test performance on next hours.

@rsa
Copy link
Member

rsa commented Sep 27, 2013

thx. possible need some simplify in grid search.

@Undergarun
Copy link
Member Author

Just a little bit faster (50-70ms), but low diff still needed! :(

@rsa
Copy link
Member

rsa commented Sep 29, 2013

after
c0b572a
3939075
e2d3432
my test server (10s grid unload + 100 random bots) not crushed oved 6hours (before - crush every 3-4 hour). avg load less on 3-4% then before, update diff stable.
try also check vmap.Dynamic.DoubleCheck option - many CPU required.

@Undergarun
Copy link
Member Author

http://pastebin.com/m3wnDbcZ Heavily unstable with MapPtrs... also false freezes detect.

vmap.Dynamic.DoubleCheck disabled for now, till less update diff.

@Undergarun
Copy link
Member Author

Question: You know why sWorld.Update(diff); in WorldRunnable::run() loop start with ~50ms of diff?

@Undergarun
Copy link
Member Author

Answer: #define WORLD_SLEEP_CONST 50 XD Forget the question!

@Undergarun
Copy link
Member Author

As i understand MapMgr diff == Map.UpdateThread with highest Update() time, right? And till all MapUpdateThreads complete its Update() cycle, World::Update does not continue. Am i right?

@rsa
Copy link
Member

rsa commented Sep 30, 2013

right, but not full - diff NOT LESS then higest map update time (thread may work with some small maps before 571 update). also currently world thread may continue - guard timer implemented, but only 2-3 times :)

Undergarun referenced this issue Oct 14, 2013
- re-add freeze VMSS operation on current code base (check config settings for avoid false-freeze!).
testing.
- use internal semaphore to synch condition broadcast
need testing with disabled freeze detection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants