PDA

View Full Version : Lag



Ardem
May 6th, 2012, 15:15
I am getting lag now every game, tonight was fairly free form and did not have maps or masks or much happening.

However we had multiple crashes, lots of laggy dice. I cannot tell why this is happening is it due to one player having a high ping affecting all, is it due to something in FRP or RMC causing it. THis was prior to even the opening of the combat module

My PC had standard Internet connection, it also was very stable in mem usage and disk usage.

I need help to identify it cause some rolls are taking 2-3 minutes to come down the channel.

Only had 5 users tonight. I don't know what else to try or look at.

It also seems to be the same two people that get the lag, one is the overseas guy and the other is in sydney, but then starts to affect all people.

Trenloe
May 6th, 2012, 16:27
Hey mate,

We experience lag when there are loops in the ruleset - we've identified 2 so far, the skill grouping and the first library window; which have both been fixed in Dakadin's recent extension.

It is more than possible that there are more loops that are still out there as the developer may have used similar methods in other areas.

I'll see if I can search the ruleset and find any others.

Trenloe
May 7th, 2012, 04:41
Can't find anything obvious (but that doesn't mean there isn't another loop somewhere).

To confirm - you're running Extend RMC v1.2.14?

Also, you're not running any other extensions that change charsheet_skilllist.lua or library_booklist.lua? These are where the 2 loops identified so far are present and fixed in Extend RMC v1.2.14.

Ardem
May 7th, 2012, 08:43
Not updated to the latest however the i know about the skill loop which we fixed prior. I will update to the latest. The library one have was not aware of but. I was getting lag with nothing open and just dice rolls.

I am planning on working on the FRP / Extend RMC this week to do the update. But would like to organise a test with a couple people to nut the issue down.

As you know I am running the FRP extension which has modifications to skilllist.lua, but no loops. Also using a locked token to 100 extension this would not impact anything as it just changes the portrait mask size.


Anyone else got a user with +300 ping in there game that would cause this issue.

Ardem
May 7th, 2012, 15:44
Did some detail ram testing and was going to post it but each time I did sidetracked and closed chrome losing the detail info. ggrrr

But in a nut shell closing library modules does not clear it from RAM

Arms law is taking a massive chunk or RAM almost 200Meg where as spell law take 50 odd meg. WHY?

Opening page of the char windows increase ram for the first time and occassionally again for the same character that you have open it never drops. Do this plenty of times it may build up your RAM usage

Image open had a temp increase in RAM then drops off when closed.

Trenloe
May 7th, 2012, 17:54
Using lots of RAM doesn't help with performance, definitely.

But, I'm also not 100% convinced that lag is just seen on the PC where the slow connection/high CPU (looping)/high memory use is happening. I think that lag is caused for all people if one PC is struggling - especially around dice rolls etc. as the messages to roll the dice and show the result have to be processed by all PCs. If one of those PCs is struggling then the dice rolling, result reported in chat will be delayed across all PCs - even if it is not the one that is rolling the dice.

So - if one PC has a loop going, then lag will be seen across all.

Dakadin
May 7th, 2012, 18:04
I am curious if it is being caused by the high ping internet session. The only time I've experienced lag in my games has been when one of the connected players internet connections was slow or unstable. Can you try connect to just them and see if you have the lag then try connecting to the others that don't have high ping? It might help isolate the issue.

If you are running Skype and FG, try having one of your players initiate the call.

Arms Law is taking more memory because of all the combat tables. It takes a lot of memory to store 20 columns by about 100 rows for the weapon tables.

When you mention open and closing the module do you mean from the modules window or the library window? I don't notice an issue with the library window anymore but that is with the latest version of Extend RMC.

lachancery
May 7th, 2012, 21:48
Arms Law is taking more memory because of all the combat tables. It takes a lot of memory to store 20 columns by about 100 rows for the weapon tables.
Hmmm... So, a copy of the table, already sitting in memory in the Arms Law module, is loaded again into the combat tracker instance? Since the combat tracker doesn't seem to release memory after it's done using a table, then it's each table could be loaded twice (or more?).

Moon Wizard
May 7th, 2012, 22:39
If createControl, createTextWidget or createBitmapWidget are called repeatedly by the combat tracker, then there could be a case where the objects are not tracked and deleted when they are no longer needed.

Also, one of the things I noticed in the RM ruleset is that all the tables were implemented as a fairly nested hierarchy of database nodes, and then each node was iterated over every time the table was used/opened. Each time a database node is accessed, then the databasenode object has to be instantiated in LUA. Also, due to the fact that FG can not assume whether the instance of the databasenode is still being referenced (i.e. linked controls, etc.), the object lives until FG is closed. This is one of the primary reasons for memory bloat in the RM ruleset. You can try looking at DB.getValue and DB.setValue to reduce the node instantiation overhead.

Finally, I would re-iterate that most of the strange drawing behavior issues that I've seen are related to endless loop conditions either in code on the same machine or implemented across the network as host and client interact off each other.

Cheers,
JPG

Ardem
May 7th, 2012, 23:47
Opening and closing is from the module window. It does not add ram (once opened) here but does not subtract it either.

Where I have seen adding of RAM is the character sheet on continuous opening and closing, but only on occassion does not repeat adding RAM when it shouldn't.

I will get the problem user to get a test session going.

Also the last session we had a high amount of disconnections, mainly from two players but even the more stable ones had a disconnection atleast once.

To rule out my connection, firstly I have a very fast cable connection, secondly I ran a speedtest and check for lost packets all was good.

PS was using 1.2.13 on the night, now using 1.2.14 for these tests. I don't feel its a looping issue as the lag happen almost from the start of the game, where no windows were open only the character sheet on there end but the skill loop had been removed on that version.
One thing I have been doing is initiate the skype calls to the group could that cause extra load, compare to receiving. I thought it did not make a difference who initiated as the skype servers act as the processing unit.

Moon Wizard
May 8th, 2012, 01:42
It's hard for me to really participate directly, since I'm not familiar with RM nor the ruleset.

From the limited debugging I did with v2.9 and the RM ruleset to catch the crash, I noticed that the ruleset has a lot of "re-entrant" code. (i.e. onFilter made calls to createWindow which triggered sorting and filtering again, etc.) Perhaps one place to look is in the onFilter, onSort, and onListRearranged code for the ruleset, and try to minimize creation/deletion within those sections. Some similar cases I have found has to do with rulesets trying to do things within onListRearranged which gets called "a lot". There is a "listchanged" parameter passed to the onListRearranged event which can be used in ways that seem more appropriate to the way I think it should work.

Also, it could still be a looping issue. I had a similar situation in the 4E ruleset when I first built it. It turned out to be a combination network/list looping bug directly in the FG client, but this was before I was on board doing development. The issue persisted until I joined the company and squashed it as one of my first projects.

Related to that, at the time I squashed the previous bug, I added a -n flag that can be run from the command line (or set via the updater in v2.9 beta). This will output every network packet to the console.log file. If you turn this log on in the client and the host, then let it sit for a few minutes without touching anything on either side once you see it, then I might be able to help pinpoint any network loops by reviewing the log files. Remember, log files get overwritten on each restart of FG. This will only help if the loop is network-based.

Regards,
JPG

Dakadin
May 8th, 2012, 08:18
I've definitely seen a few issues where things are called more times than I think they need to be especially with the table resolver.

Thanks for the information JPG. It is very useful. I definitely plan on tracking them down but the only way I knew of was to basically step through the code using debug statements. Now I should be able to look at some of the points you specified to try to track it down which should save me some time and will move it up on my priority list a bit.

Dakadin
May 8th, 2012, 08:20
Hmmm... So, a copy of the table, already sitting in memory in the Arms Law module, is loaded again into the combat tracker instance? Since the combat tracker doesn't seem to release memory after it's done using a table, then it's each table could be loaded twice (or more?).

I am not sure at this point what it loads or doesn't load. I've only really watched the memory usage while doing various activities to help me get an idea of when memory is being used. I would need to spend more time picking it apart to really be able to answer the question a bit better. I do have a few guesses though.

Dakadin
May 8th, 2012, 08:25
Opening and closing is from the module window. It does not add ram (once opened) here but does not subtract it either.

Where I have seen adding of RAM is the character sheet on continuous opening and closing, but only on occassion does not repeat adding RAM when it shouldn't.

I will get the problem user to get a test session going.

Also the last session we had a high amount of disconnections, mainly from two players but even the more stable ones had a disconnection atleast once.

To rule out my connection, firstly I have a very fast cable connection, secondly I ran a speedtest and check for lost packets all was good.

PS was using 1.2.13 on the night, now using 1.2.14 for these tests. I don't feel its a looping issue as the lag happen almost from the start of the game, where no windows were open only the character sheet on there end but the skill loop had been removed on that version.
One thing I have been doing is initiate the skype calls to the group could that cause extra load, compare to receiving. I thought it did not make a difference who initiated as the skype servers act as the processing unit.

Thanks for being willing to test that Ardem.

In Lachancery games, when he was starting the Skype session we were experiencing lag. Since I've been starting the Skype sessions we haven't been experiencing lag except for maybe last Friday but we had a situation last Friday where one of the players was having network issues and was getting dropped from Skype and FG. I didn't experience any lag that I noticed but I am pretty sure Lachancery mentioned that he was experiencing some lag.