Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripts & Sim Performance

HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
08-06-2008 19:17
Generally, how many active scripts does it take to affect sim performance negatively?
_____________________
Virtual Freebies now has its own domain!
URL=http://virtualfreebiesblog.com

The Mall at Cherry Park - new vendors, new look!
Meh Baxton
Registered User
Join date: 27 Jul 2008
Posts: 15
08-06-2008 20:47
It depends on what the script does.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
08-06-2008 21:08
it's certainly possible for a small number of scripts to cause sim performance to degrade--for example, if those scripts are rezzing a bunch of objects, causing heavy physics calculations, doing a lot of prim manipulations, even (bizarrely enough) llSleep()ing.

But there are also factors that are a function of raw script count. A few months ago, Des posted some guidelines from experience of when Class 4 and Class 5 full sims would start to lag due to simple script count. I gather that at least some of that was due to memory consumption by the scripts. (It's also true that with the current scheduler, each script in the Running state gets a tiny slice of CPU each frame--even scripts with no active event handler. That's pretty ugly, but I doubt that accounts for much lag, in practice.) Unfortunately, I can't recall Des's numbers, nor can I find the thread at the moment.
HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
08-07-2008 03:30
My sim is currently running ~7000 active scripts according to the stats console. Accordingly to region tools>debug window, there are roughly 700 scripts, taking a total of 4.3ms.

I've had a tenant complain about lag, but that tenant is on a very old computer. I think the main culprit is a waterfall cave on the sim - it's sculpty and takes up 1/4 sim, and unfortunately, at this time, it's non-negotiable. There are no temp rezzers. There are a lot of vendors on the sim, and the rest of it is all rent boxes, and then the usual household stuff.

I don't see any of it as "overly burdensome", but apparently it is for her. I'm going to lose her as a tenant over this, unless I can show that my sim just isn't that laggy. :(
_____________________
Virtual Freebies now has its own domain!
URL=http://virtualfreebiesblog.com

The Mall at Cherry Park - new vendors, new look!
Sassy Romano
Registered User
Join date: 27 Feb 2008
Posts: 619
08-07-2008 04:03
the sim that i am on has much the same numbers, 699 scripts 4.1ms.

I read that if the time dilation is >0.96, total frame time <20ms and sim fps >45 then all is well.

If the sim is full and has lots of objects then they will take time to render. I find people often assume that somewhere is "laggy" just because they're waiting for rendering

One of our residents installed a set of cushions on their beach. 80 prims! About 20 poseballs each no doubt with a public chat listener, i suspect i will be teaching him how to replace those with anti pose ball scripts or no listener scripts. He was surprised that his cushions were the biggest culprit on the sim even with all my kinky toys.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
08-07-2008 04:06
That's a lot of scripts. I found the post I was looking for: /327/b1/226444/1.html#post1780524... maybe it can help.

If the enormous sculpty waterfall is animating sculptmaps by script, and there are a lot of sculpty prims to animate, that could be pretty laggy all by itself. The script execution itself wouldn't be the culprit, but rather the constant streams of object updates it would generate that would have to get pushed to every agent anywhere near it.

Of course, it could be something else, too, or just something subjective on the part of the complaining tenant. But both total script count and a quarter-sim of animated sculptmaps sound pretty scary.
Semolina Semaphore
Registered User
Join date: 24 Oct 2006
Posts: 130
08-07-2008 04:17
From: Sassy Romano


i suspect i will be teaching him how to replace those with anti pose ball scripts or no listener scripts.


what's an 'anti pose ball script' ?
HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
08-07-2008 04:18
Time Dialation >.99
Sim FPS >44.7-45

This tenant does live very close to the sculpty mountain/waterfall, but she said the lag existed on our old sim, which did not have the waterfall. It had *a* waterfall, but not the sculpty mountain. I really suspect this is just her computer, but if it's happening on my sim and not on others, it's a moot point.
_____________________
Virtual Freebies now has its own domain!
URL=http://virtualfreebiesblog.com

The Mall at Cherry Park - new vendors, new look!
Skell Dagger
Smitten
Join date: 26 Jun 2007
Posts: 1,885
08-07-2008 04:23
Lots of active scripts on the parcel next to mine; the store owner has a lot of temp rezzers. Last time I looked, the script count was around 5000, and time dilation has been bloody awful the past few days. It's usually around .80 but for the past few days, even after a sim restart it's been around .50 and dipping into the mid .20s. Overall FPS tends to be the low 30s, but the sim is constantly lagged and walking turns into an exercise in struggle-and-guess-how-far-you'll-rubberband. :(
_____________________
It always ends in chickens...

Store blog - http://primflints.wordpress.com/
Inworld - http://slurl.com/secondlife/Jindalrae/21/25/442
XStreet - http://tinyurl.com/primflints
Photos - http://www.flickr.com/photos/skelldagger/
HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
08-07-2008 04:32
I took up a few things showing high on the debug screen....my dog, my cat *sob*, some games.

Active Scripts >6884

But no significant increase in performance, because the performance just wasn't that bad to begin with.

Any hunters feel like taking a gander at it today? It's Cherry Park sim.
_____________________
Virtual Freebies now has its own domain!
URL=http://virtualfreebiesblog.com

The Mall at Cherry Park - new vendors, new look!
Georg Stonewall
Husband of Nikki
Join date: 21 Jan 2007
Posts: 211
08-07-2008 04:41
I don't think it is the scripts. If the scripts are the reason then all resident should have this problem, regardless of their PCs. Scripts only stress the Server not the client.
Maybe it would be a good idea to sit down with her and check the settings of her client.
_____________________
G&N Quality Design


SLURL

Blog

Flickr

XStreetSL
Atom Burma
Registered User
Join date: 30 May 2006
Posts: 685
08-07-2008 05:19
Avoid colissions as well, those damn wind chimes are enough to crash an unstable sim.
HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
08-07-2008 05:37
From: Georg Stonewall
I don't think it is the scripts. If the scripts are the reason then all resident should have this problem, regardless of their PCs. Scripts only stress the Server not the client.
Maybe it would be a good idea to sit down with her and check the settings of her client.


Hey, hi Georg :)

I've heard that she's on an older laptop - which to me just says "problems galore". But I know for sure that she hangs out at a club on one of the laggiest sims I've ever been on, so I just can't figure out why she's fine on that one, but not on mine.
_____________________
Virtual Freebies now has its own domain!
URL=http://virtualfreebiesblog.com

The Mall at Cherry Park - new vendors, new look!
Sassy Romano
Registered User
Join date: 27 Feb 2008
Posts: 619
08-07-2008 05:52
From: HoneyBear Lilliehook
But I know for sure that she hangs out at a club on one of the laggiest sims I've ever been on, so I just can't figure out why she's fine on that one, but not on mine.

Sounds like neva naughty? Nobody moves once there thats why its not a problem :)

Get her to turn on the lag meter and see where it suggests the problem is.
HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
08-07-2008 05:55
From: Sassy Romano
Sounds like neva naughty? Nobody moves once there thats why its not a problem :)

Get her to turn on the lag meter and see where it suggests the problem is.


That's not it, and I can't say where it is cuz that would just be tacky...lol
_____________________
Virtual Freebies now has its own domain!
URL=http://virtualfreebiesblog.com

The Mall at Cherry Park - new vendors, new look!
Sassy Romano
Registered User
Join date: 27 Feb 2008
Posts: 619
08-07-2008 05:56
From: Semolina Semaphore
what's an 'anti pose ball script' ?

Sit script directly in the prim instead of a poseball.

Saves a prim per item which will save my friend about 20 as long as the item is mod
Georg Stonewall
Husband of Nikki
Join date: 21 Jan 2007
Posts: 211
08-07-2008 06:14
From: HoneyBear Lilliehook
Hey, hi Georg :)

I've heard that she's on an older laptop - which to me just says "problems galore". But I know for sure that she hangs out at a club on one of the laggiest sims I've ever been on, so I just can't figure out why she's fine on that one, but not on mine.



Hi Honeybear, yes it's a small world :-)

Well I think there are emotions in the case. If you really like to hang out at a place, then some lagg don't seems to be a big problem.
But of course, in that case it could become difficult to tell her it is her computer.
But anyway give it a try. Only to uncheck the ground setting (don't know the right label in moment) pays up to 5 FPS. And of course the draw width (is that the right label? hmm don't know) is always a problem.
_____________________
G&N Quality Design


SLURL

Blog

Flickr

XStreetSL
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
08-07-2008 07:48
From: Qie Niangao
That's a lot of scripts.

I saw my home sim go over 9k active scripts the other day. :( It's not on one of them new-fangled class 5 servers either..

From: Qie Niangao
If the enormous sculpty waterfall is animating sculptmaps by script, and there are a lot of sculpty prims to animate, that could be pretty laggy all by itself. The script execution itself wouldn't be the culprit, but rather the constant streams of object updates it would generate that would have to get pushed to every agent anywhere near it.

Size matters not, unless you're talking about size as the number of prims in the object. Show Updates, under the Client/Advanced menu, or ctrl-alt-shift-D, is a great tool here.

http://support.secondlife.com/ics/support/KBAnswer.asp?questionID=4636

From: Skell Dagger
Lots of active scripts on the parcel next to mine; the store owner has a lot of temp rezzers. Last time I looked, the script count was around 5000, and time dilation has been bloody awful the past few days.

Temp rezzers are _REALLY_ easy to abuse. If the store owner has them set to rez stuff automatically instead of only when a customer wants to see something, you should definitely talk to them about it.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Argos Hawks
Eclectically Esoteric
Join date: 24 Jan 2007
Posts: 1,037
08-07-2008 14:28
A good way to see if you are having script lag is to hit cntrl-shift-1 and look in the Time section for Total Frame Time. The server doesn't start slowing down scripts until Total Frame Time hits 22ms. Then it slows down scripts by whatever is necessary to keep it at 22. If you see something much over 22ms, it means that there are so many script operations running that the server can't slow them down enough to help.

If you're total frame time is under 22ms, it's a good chance that the lag they are feeling is from the textures, or something in their hardware that can't handle the load.
_____________________
Step 1: Create virtual world
Step 2: ???
Step 3: Profit
HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
08-07-2008 17:41
From: Argos Hawks
A good way to see if you are having script lag is to hit cntrl-shift-1 and look in the Time section for Total Frame Time. The server doesn't start slowing down scripts until Total Frame Time hits 22ms. Then it slows down scripts by whatever is necessary to keep it at 22. If you see something much over 22ms, it means that there are so many script operations running that the server can't slow them down enough to help.

If you're total frame time is under 22ms, it's a good chance that the lag they are feeling is from the textures, or something in their hardware that can't handle the load.


Did as you suggested, and it held steady at 18.7-19.9, with one quick spike to 21.5 when I rezzed my dog, and then it settled back down to 19.4 and held.

After this thread, and checking things out, I'm at the conclusion that it simply isn't my sim. If she can't move around here, there's simply nothing I can do but wish her well.
_____________________
Virtual Freebies now has its own domain!
URL=http://virtualfreebiesblog.com

The Mall at Cherry Park - new vendors, new look!
Skell Dagger
Smitten
Join date: 26 Jun 2007
Posts: 1,885
08-07-2008 17:48
From: Argos Hawks
A good way to see if you are having script lag is to hit cntrl-shift-1 and look in the Time section for Total Frame Time. The server doesn't start slowing down scripts until Total Frame Time hits 22ms. Then it slows down scripts by whatever is necessary to keep it at 22. If you see something much over 22ms, it means that there are so many script operations running that the server can't slow them down enough to help.

If you're total frame time is under 22ms, it's a good chance that the lag they are feeling is from the textures, or something in their hardware that can't handle the load.
/me snorts. Total frame time in my laggy sim is currently 34.4

That says a lot for how bad it is here. And it just went up to 39... and 42... back down to 34...

There are some scripted sculptures in a thin strip of land next door to me that shift and move. Those could be why it's fluctuating like that.
_____________________
It always ends in chickens...

Store blog - http://primflints.wordpress.com/
Inworld - http://slurl.com/secondlife/Jindalrae/21/25/442
XStreet - http://tinyurl.com/primflints
Photos - http://www.flickr.com/photos/skelldagger/
HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
08-07-2008 17:52
OK, this may sound like a stupid question, but is it ok if your FPS is at like 67.1? I mean, could being out of range on the high side be a problem?
_____________________
Virtual Freebies now has its own domain!
URL=http://virtualfreebiesblog.com

The Mall at Cherry Park - new vendors, new look!
Argos Hawks
Eclectically Esoteric
Join date: 24 Jan 2007
Posts: 1,037
08-07-2008 19:06
From: HoneyBear Lilliehook
OK, this may sound like a stupid question, but is it ok if your FPS is at like 67.1? I mean, could being out of range on the high side be a problem?

Personal FPS, or the sim FPS. For personal FPS, the higher the better with no upper limit. The way I understand it, the sim FPS can't go above it's limit (45 I think).
_____________________
Step 1: Create virtual world
Step 2: ???
Step 3: Profit
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
08-07-2008 19:21
From: Argos Hawks
the sim FPS can't go above it's limit (45 I think).

This is true. It used to be, before my time, that sims would run as fast as they could but now they're throttled to go no more than 45 FPS.

At least one Linden is looking at dropping the FPS on a sim if there's nobody there. In theory, that might give a little more horsepower to other sims on the same physical host. On an host that's running openspace sims, it'd mean that idle open spaces would have less impact on other sims running on the same core. Good stuff.
HoneyBear Lilliehook
Owner, The Mall at Cherry
Join date: 18 Jun 2007
Posts: 4,500
08-07-2008 19:40
From: Argos Hawks
Personal FPS, or the sim FPS. For personal FPS, the higher the better with no upper limit. The way I understand it, the sim FPS can't go above it's limit (45 I think).


Thanks for your help!
_____________________
Virtual Freebies now has its own domain!
URL=http://virtualfreebiesblog.com

The Mall at Cherry Park - new vendors, new look!