Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Since when does sitting cause so much lag ?

Max Duesenburg
Registered User
Join date: 13 Sep 2006
Posts: 33
12-21-2006 07:32
As an estate manager I have access to the estate manager tools and I've recently noticed an interesting phenomenon. While lag hunting I noticed that many of my chairs seemed to generate an inordinate amount of lag - Up to and over 0.5ms at times - simply for having someone sitting on them. I first noticed this with my own scripts but a quick check showed no obvious reason for the lag. It also appeared to happen with other commercial pose balls and the like.

Most pose scripts tend to be very similar and there is no reason for them to use any significant resources except when someone sits or stands. When an avatar actually sits the script should be passive. So I did a little experiment as follows...

Create a box - Name it 'Test Box' or something similar - Now create a 'New Script' in said box - Sit on it - Check the lag using the estate tools - It's using about 0.4ms for no reason!

Stand up - Lag drops to 0.003ms - What I would expect from a passive script.

Set the script to not running - Sit on the box - Lag is up to 0.4 again!

Now heading to an empty sim with stable frame/script time and checking for lag seems to contradict these results with no impact on either.

So what is going on? Are the estate manager tools giving false readings (which makes them pretty much useless) or am I missing something ?

I've also noticed on the rare occasions when the Sim I manage is empty, that the times given in the tools seem to bear no relationship to the sim stats. According to the tools the top 500 (approx) scripts take abut 5ms - From the stats there are 1500 scripts (approx) each using a maximum of 0.002ms (Or else they would be in the top 500)

This gives the impression that the total script time should be around 5.2ms, not around 15ms (Empty sim, me naked as far as attachments/scripts goes).

I guess that the two things might use a different way to calculate script time (which would be annoying and illogical but at least could still be useful in tracking down laggy scripts) but it's certainly none too obvious what's going on, and the result of my experiment as shown above is certainly anomalous.

Anyone else find the same thing happening ?

Even better anyone shed some light on why it's happening ?

Max Duesenburg
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
12-21-2006 10:08
New Script gives you a touch_start event handler. I'm curious if taking that out of your test prim box changes anything.
Xaria Concord
Funky Stuffs Designer
Join date: 30 Jun 2005
Posts: 104
12-21-2006 11:20
Hi Max,
It is really a coinicidence that you have started this thread. I have also been checking into top scripts, lag, and script time of objects and things on an island I am also a manager of. Last week we were noticing a few things, and I started a little investigation of my own.
While going through the top scripts I was noticing things like "sofa owned by XXX" showing a time of 2.340. I thought to myself, wow a simple sit animation pose ball surely cannot be causing the time ms to be that high on just a sofa. Becoming alarmed I called in a couple of my friends who I know are programmers irl and scripters and such in sl. As we flew around to these diff objects, we noticed that an avatar was sitting on the "sofa". As I kept the top scripts screen up ready to refresh, we had him to stand up off the sofa to see what would happen. He wound up clicking and sitting on a floor prim called "object" and that object then registered a 27.00 ms in top scripts. The time dilation dropped for a few seconds and we started looking for any scripts that may have been dropped into that floor prim named "object". The total time was at 47.000 ms - WAY over the 22.3 ms that time cannot be over before the time dilation of a sim starts to drop. After another 5 mins or so of searching that prim, we couldnt find anything in it, under it, or around it, that was scripted. Meanwhile, the avatar had sat back down on the sofa, and it was registering again at 2.000 up to 4.000. As I had my tools menu open, I held down alt, and noticed red glowing orbs around this avatar who was sitting on the sofa. Then it hit me - it wasnt the sofa that was scripted causing the time to go up, it was the scripted objects worn by this particullar avatar. Scripted guns, blinking eyes, and im sure a multi gadget tool were only showin in top scripts when he was sitting on an actual object in the sim. While these scripts had always been running, we had no way of knowing the actual damage (lag) it was creating until they sat on an object that we could monitor in top scripts.
Now with the ctrl+shift+1 stat menu you can see "total scripts, and script perf, etc." but what you cannot see is the actual time an attached scripted device on an avatar, is taking up in your total script time on your sim.
Just to be sure we were correct on this, I attached my annimation overrider, and stood on a posing stand, and then a vehicle. My AO alone was registering a motorcycle at 0.420 on the sim, and when I took off my AO and got back on the same motorcycle and reviewed it again, the motorcycle came out to 0.200.
While we were doing all of these little tests to try and answer some questions in our own minds, we found a thread that was very interesting and answered a lot of questions we had. I have put in a link to that below. I hope this makes some kind of sense to you, I dont have fancy technical ways of explaning things, but sometimes someone kicking things around in black and white instead of fancy techie talk helps more than anything. I know it does for me at least. LOL
In summary of all of this, it is very true that ao's, multi gadgets, and other worn scripted items; are hell on a sim's time - and having enough of these objects firing off at one time in a sim can cause the time to exceede 22.3 ms, therefore causing the time dilation to drop, and the sim becoming unstable (or creating lag).
Also in relation to all of this, we found a few scripted items we had out on the island - that were taking up quite a bit of time and got rid of them. It also seems that the more items you have that are using more time; are then; in turn causing other items that werent using so much time before, to then show a higher time. For instance: A sign that was scripted only to give a notecard on touch, was registering 0.003. After we noticed some issues with lag, time dilation, and a high script perf - we opened top scripts, and saw that when the objects we had out that were registering high around 0.500 +, it was causing the sign with the notecard giver to then register around 0.060. I assume, since the other objects were using more time, it was assigning more time to the other minor scripted objects in the sim, causing it to have a higher ms than before.
Here is a link that explains time ms and what happens when it is over 22.3 ms on a sim:
/54/8f/145472/1.html

Take care and good luck relieving the lag on your estate! Xaria
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
12-21-2006 12:40
Two issues here. First: why does sitting result in a much higher script time in the estate tools top scripts list? Second: why does the sum of all script time in the top scripts list not jive with the Script Time stat?

The first has a simple answer. Scripts in attachments worn by avatars aren't shown in the top scripts list (this annoys me no end). When an avatar sits on an object, they become linked to the object, acting as if they're a child prim. The Top Scripts list shows the total script time for all child prims in a link set summed into one stat... so when an avatar sits on an object, the total script time for the scripts they're wearing is added into that object's script time in the display. This can be a good way of measuring a person's lag.

The second has an annoying answer. It turns out that the script managing system in the sim has some kind of absolute overhead per script. This overhead isn't reported in the Top Scripts list, but it is reported in the Script Time list. So, the "missing" time that you can't account for is that per-script, per-frame time overhead. That overhead, from what I can tell, accounts for the vast majority of the overall load involved in processing scripts... NOT what the scripts are actually doing. That said, of course, if scripts are doing laggy things, they can take up much more script time.
Max Duesenburg
Registered User
Join date: 13 Sep 2006
Posts: 33
12-21-2006 20:01
Ahhh, that certainly answers my first question. Just did a little testing and yes, it's the attachments that make all the difference - Removing all attachments and repeating my tests showed a zero increase to script time caused by sitting down.

I had been under the impression that it was impossible to check the lag caused by attachments and that they didn't show up under any circumstances in the estate tools - nice to know that they do and yes, it's a very useful thing to know :)

As to the touch_start event, it has no effect - I checked that myself by turning the script off.

As to the second part of my question...

I was under the impression that each running script had an overhead of approximately 0.003ms, even when passive. This appears to be borne out by testing. An object with 10 passive scripts gave a reading of 0.029. Setting all scripts to 'not running' left it with a reading of 0.003 or less. This would seem to indicate that the absolute overhead IS actually taken into account in the estate tools.

Sadly I'll have to wait until my island is empty to do any further testing, but in the meantimeI think I'm going to set a lot of scripts to 'not running' and see what effect that has on script time.

Thanks for the info guys :)

Max Duesenburg
Andy Enfield
Hippo Technologies CEO
Join date: 22 Nov 2005
Posts: 79
12-21-2006 22:31
I had noticed last night that the very act of sitting itself caused the *client* to noticeably stutter ... so there is something going on here.
Max Duesenburg
Registered User
Join date: 13 Sep 2006
Posts: 33
12-22-2006 12:02
Personally I'd be more than happy just to get a stutter :)

Over the last while I've found the act of sitting to be perilous in the extreme. Sitting down regularly puts me into 'limbo' for a while, floating in nothingness. Even after successfully sitting I seem to jump up again for no apparent reason (I know this happens when changing clothing if I sit before the clothing rezzes, and I've also heard that an IM from a script can cause the same thing) and standing up more often than not kicks me halfway across the sim.

I've even had one of our guests ask me why I orbited them. It seems he was sitting in one of my seats and got orbited for no apparent reason and it registered me as the person who bumped him. Note that I wasn't even on at the time and there was nothing in the script that could have caused this effect.

All these things are happening on a sim where I'm making every effort to keep lag down as much as possible, with reasonable success (We regularly have 20+ people with no time dilation). For the record it also happens to me and others both on Amore and elsewhere so it's not confined to one sim.

Doubtless these issues will be addressed in a future update. (Hmmm does sarcasm translate into text ?)

Max Duesenburg