Jump to content
You are about to reply to a thread that has been inactive for 109 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Posted

I want to put a largish project on someone's land, and the owner is worried about number of scripts. (around 300). I think her issue is lag. Is the number of scripts an iue? The scripts are usually quiescent and just listening or waiting to be clicked on.

  • Like 1
Posted

Before the script efficiency update a few years back, large numbers of scripts could have a pretty noticeable effect on lag, but the issue is a fair bit less pronounced now. Even scripts that aren't "doing" anything do take up some resources for the region to determine if they ~should do something though. (one of the reasons why it's best practice to close script listeners when there's no expectation of them activating)

Not an issue here, but a large number of scripts in attachments can sometimes be the most easy to point to/measure reason for a "lag spike" when an avatar enters a region.

  • Like 3
Posted

There is a persistent myth that scripts somehow cause lag on a region.  The servers, however, prioritize scripts last as they allocate time to various running tasks.  This means that other things that might eat up the servers' attention -- like avatars or physical objects, for example -- might make scripts lag if the region is really busy, but scripts won't make other things lag.  It is possible for very intensive scripts to slow each other down, of course -- the SL equivalent of a RL bitcoin mining operation putting a strain on local networks -- but that's very rare. As you point out, most common scripts are quiescent most of the time, and then use only a fraction of a millisecond when they are active.  Trying to explain this to a determined landowner can be like talking to a brick wall, though, so don't hold your breath.

  • Like 1
  • Thanks 1
Posted

I'd be a tiny bit cautious about too many listeners open simultaneously on the same channel unless they only ever receive llRegionSayTo messages or the messages are very few and far between. Otherwise 300 quiescent scripts shouldn't be noticeable, even to other scripts, unless there are a tremendous number of other scripts on the region. You can kinda get a sense of how much headroom the region has by looking at sim statistics (same as Quistess suggested), focusing on Spare Time and Scripts Run percentage, but I really doubt that's necessary here.

(I'll just mention that there was a time when script memory could also be a consideration, but not at this scale, and certainly not anymore.)

  • Like 1
Posted
5 minutes ago, Christina Halpin said:

a script in an object that does not run unless clicked on doesn't use any resources (until clicked on)

I wouldn't say it uses 0 resources, just close enough to 0 that it shouldn't be a problem.

  • Like 2
Posted (edited)

LL can, and will, call out a landowner for excess resource usage if you have to many scripts running on a parcel. 

The stats go by land size and if the 300 scripts puts the landowner above what their share of the regions resources is, then LL will come down.

I have no clue of the scale used, but I have been called out by LL for it myself due to a neighbor filing constant ARs about me when I first bought the land I'm on now.

If they own the entire region, this may not be an issue.

"...doesn't use any resources (until clicked on)."

This is untrue. If it has a touch event, then it is waiting on that event, and using some resources doing it.

If a script is running, it's using resources. It may be a minute amount but it is using them.

Stack 300 pennies together and you get a decent sized pile, even if they are just pennies.

Edited by Artorius Constantine
  • Like 1
Posted

As an illustration of the effect of scripts on performance, here's a snapshot of the stats on my own region right now:

image.jpeg.1a40ba5c1822a5f9cceb191bf9b835f2.jpeg

Look at my red arrows. I and others on the region have 5443 scripts running at the moment. I use the region for my own script development, so that's why the region so many scripts running. As Artorius points out, even idling scripts use some small amount of the servers' time, and it does all mount up. In this case, those 5443 scripts are using 8.642 ms or 39% of the server time allocation. That's quite a bit -- a lot more than many places you'll visit -- but it still leaves the region with 11.295 ms of spare time.  Half of the time, then, the region is "sleeping".

Notice that sim FPS is 45.0 and there is almost no time dilation.  The region is not lagging. You can't see it here, but I am running the Firestorm viewer at High quality and am getting 60.5 FPS myself. (That personal FPS can vary, dropping to the low 50s sometimes and peaking at over 90 at others. It's a range that I find quite comfortable.)  Also, notice that when I took this screen shot there were only two of us on the region. Agent time, therefore, is only 0.159 ms or 0.3% of the total time allocation.  We could have 40 of our closest friends visit and still have plenty of spare time left. We never have that many people around, of course, and we have never had a lag problem.  Could we, though?

Look at the Physics Time -- 1.315 ms.   That's about 6% of the available allocation. I have seen regions with WAY more Physics time.  (In fact, I visited one a few years ago where they had installed a physical meteor circling continuously overhead, eating over 90% of the time allocation!)  Remember that I said in my first post here that scripts get the lowest priority for server time.  If my friends and I were to start running lots of vehicles and supporting other physical objects, they might use up enough time to start making scripts lag and stall. With enough physical objects demanding server time, other things (like avatars) would start to lag too.  So, I could find ways like this to cause lag issues, but I can't do it with scripts because they're the first to die.

  • Thanks 1
Posted
1 hour ago, Artorius Constantine said:

 

"...doesn't use any resources (until clicked on)."

This is untrue. If it has a touch event, then it is waiting on that event, and using some resources doing it.

Suppose a script was acted on by touch. LL labs could send that information to the avatar's viewer and be done with the task until the avatar's viewer reported a touch. Right? So, Zero time. The avatar's viewer wouldn't have to do any processing until the object was touched or hovered over. Right?

 

Posted
3 minutes ago, Christina Halpin said:

Suppose a script was acted on by touch. LL labs could send that information to the avatar's viewer and be done with the task until the avatar's viewer reported a touch. Right? So, Zero time. The avatar's viewer wouldn't have to do any processing until the object was touched or hovered over. Right?

Scripts run on the server, not the viewer. An idle script will still take up a tiny slice of time to check if there are events it should respond to, but it takes a lot of those slices to make it add up, as per Rolig's post above. If you want the server to give no time to a script at all, it'll have to be set to not running.

  • Like 1
Posted
2 hours ago, Artorius Constantine said:

LL can, and will, call out a landowner for excess resource usage if you have to many scripts running on a parcel. 

The stats go by land size and if the 300 scripts puts the landowner above what their share of the regions resources is, then LL will come down.

You are saying that simply the number of scripts might be a problem. I think my hoped-for landlady has the same worry. So the idea is that if I created too many of this scripts LL or the region owner mightcomplain, even though it uses no resources

default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar!");
    }

}

 

You are not alone, though no one on this thread seems to be saying that. The SL Wiki says "

That webpage does not exist, and I am guessing that information is out of date.

I thank you for your reply and I thank everyone for their replies. 

 

 

  • Like 1
Posted
9 minutes ago, Christina Halpin said:

That webpage does not exist, and I am guessing that information is out of date.

Indeed.  That's what Tessa was referring to earlier:

22 hours ago, Quistess Alpha said:

Before the script efficiency update a few years back, large numbers of scripts could have a pretty noticeable effect on lag, but the issue is a fair bit less pronounced now.

 

Posted
9 minutes ago, Christina Halpin said:

That webpage does not exist, and I am guessing that information is out of date.

Try this link and search for "scripts". There's a pink-shaded box to which that wiki quote apparently refers, but it isn't talking about the total number of scripts in a region or anything, it's about the maximum number that is apparently supported in a single rezzing operation from Inventory to the region. That doesn't mean it's still valid, but in any case it's not the concern here.

It's possible, however, that the landlady's concern is partially motivated by something related to scripts rezzing-in: People very often experience enormous lag when a large number of scripts are first introduced to the region, especially as part of a heavily attachment-loaded avatar rezzing-in by teleport. That's not your situation, of course, but it's such a pain point that folks may be excused for a bit of overgeneralization. (Also, in passing, this rezzing-in pain may reduce some in the foreseeable future, as some fixes go in—although we don't know the full extent of those improvements yet.)

Scripts already rezzed and waiting for events do not use much resources, but it's true, it's not zero. Exactly how scripts end up getting scheduler attention isn't guaranteed to stay the same, so getting too in the weeds is not a win here, but a few years ago a script would consume some scheduler time just by virtue of being set Running even if there was no event handler that could possibly fire (e.g., a script that loops some sound at state_entry and never does anything again); that overhead is effectively zero now, so simple static script count is as near meaningless as makes no difference.

Waiting on touch_start is almost as quiescent until a touch_start event is generated by a message from viewer to region, but then there's a dispatching problem of recognizing which handlers of all the touch_start handlers on the region might get this event. Listens can have a more difficult dispatching problem, which is the origin of the advice to make their filtering conditions as specific as possible.

I think I've rambled too much several paragraphs ago. Sorry 'bout that.

  • Like 3
Posted
46 minutes ago, Qie Niangao said:

 

I think I've rambled too much several paragraphs ago. Sorry 'bout that.

Heavens no! All good info. Yes, I noticed that initial increase in resource-use when I rezzed a script, and I wondered about it. It was about .07 ms, which i relatively a lot, then after a minute or two it apparently dropped to nothing.

  • Like 2
Posted (edited)
5 hours ago, Christina Halpin said:

That webpage does not exist, and I am guessing that information is out of date.

The link is up to date, the URL just had some extra text at the end. I fixed it now, thanks for pointing it out.

And regarding idle scripts -- it's not difficult to verify that idle scripts do contribute to script lag. You can consume all of the Spare Script Time on a sim by rezzing a couple thousand default scripts.

Edited by Wulfie Reanimator
  • Like 1
Posted
1 hour ago, Wulfie Reanimator said:

The link is up to date, the URL just had some extra text at the end. I fixed it now, thanks for pointing it out.

And regarding idle scripts -- it's not difficult to verify that idle scripts do contribute to script lag. You can consume all of the Spare Script Time on a sim by rezzing a couple thousand default scripts.

Thanks Wulfie, you're the best. . It says "Maximum number of scripts that can be rezzed at once" Maybe that can be rezzing instead of rezzed? My land has accumulated 1000 rezzed scripts over the past two years and there is no problem. (I assume that after I rez an object, it is rezzed until I take it down. True?)

 

Posted
17 hours ago, Christina Halpin said:

Thanks Wulfie, you're the best. . It says "Maximum number of scripts that can be rezzed at once" Maybe that can be rezzing instead of rezzed? My land has accumulated 1000 rezzed scripts over the past two years and there is no problem. (I assume that after I rez an object, it is rezzed until I take it down. True?)

Yeah, the Knowledge Base article that the wiki is referring to is talking about how many scripts you can rez at once, in a single action. You won't be able to rez an object (or a group of objects) from your inventory if it contains more than 1000 scripts, but there's no hard limit on how many scripts can exist on a sim in total.

Posted

I thank everyone for their answers, they were a big help. I will try to summarize.

A script uses resources when rezzing, though that is not my issue. There is a limit on that, but no limits on number of rezzed scripts. The only issue is time used, not number.

I still think a quiescent script might not use any resources; people have diisagreed, but the practical issue is that the resources used by a quiescent script, even if it is listening on a channel, are too small to matter or worry about.

A script that is using a lot of resources can affect only other scripts.

It is up to me to verify that either (1) my landlady is not worried about lag in scripts because she is not using scripts (unlikely); (2) my scripts do not use a relevant amount of resources (likely), or (3) I close my animations when she is concerned about lag (which should probably happen anyway).

 

  • Like 1
You are about to reply to a thread that has been inactive for 109 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...