Jump to content
Sign in to follow this  
Soto Hax

Reasonable region script time?

Recommended Posts

Question for the experts: What is a reasonable amount of total script time for each type of region? Like an amount beyond which you'd start to see noticeable region performance degradation (sim lag) if we assumed each region on a processor is the same region type with the same total script time?

Edited by Soto Hax
Updated tags

Share this post


Link to post
Share on other sites

You will never see performance degradation. The script time is irrelevant.

The scripts will get the remaining free time of the simulator. That means the more stuff the sim has to do (for example due to handling many avatars) the less time will be given to the scripts. So the scripts have no influence on the sim performance.

If you have (for example) twice as many script time demand than the simulator provides then only every 2nd script will get a timeslice in every frame. As a result all scripts will run at half speed in this example. So the only thing scripts will lag is - scripts.

 

  • Like 2

Share this post


Link to post
Share on other sites
On 1.7.2017 at 0:56 PM, Soto Hax said:

Question for the experts: What is a reasonable amount of total script time for each type of region? Like an amount beyond which you'd start to see noticeable region performance degradation (sim lag) if we assumed each region on a processor is the same region type with the same total script time?

As @Nova Convair said, running scripts is the lowest priority task for the server so it won't usually affect other functions but that means too many scripts will cause script failures and that can be a problem in itself.

It's also important to note that scripts can trigger laggy events. HTTP requests will increase the Net Time, vehicle script are likely to add to the physics time and so on.

Also, launching new scripts can cause lag. When an avatar enters the sim, the server has to load all the script it carries with it and that will cause a short lag peak. If the avatar is heavily scripted, it may be a very high peak. Usually those peaks are too short to be significant but if it's a sim where people keep tp'ing in and out all the time, it can become a serious issue.

In other words, even though script lag generally is a thing of the past, it's still a very good idea to try to keep the script load as low as possible.

What is a "safe" amount of total script time depends on what other tasks the server is kept busy with. If the total frame time is higher than 22-point-a-bit ms, it's an overloaded sim. If the spare time is less than a millisecond or so, the sim is pushed hard enough you must expect occasional glitches but not cntinuous poor performance.

  • Like 1

Share this post


Link to post
Share on other sites

I have to chime in here because there is some misrepresentation of the facts. While it's true that while running, scripts run in "Spare Time" and won't impact anyone directly, scripted attachments can still significantly impact a sim in many ways. As ChinRey mentioned, scripts can trigger other laggy behavior based on what they do. Worse though, is when scripts are "moved" in and out of a sim. When someone TPs, all the scripts in their attachments need to be suspended and "moved" to the new sim. The code, the data, the current state for each and every script needs to be dealt with. There is the network impact of the actual transfer of that data, but also this triggers the Region change event, which will cause new HTTP connections / handles to be created for any script that needs them, etc. There is also the impact that instantiating the script has on the region's script engine, accepting the data, scheduling, etc. etc. etc. There is a LOT that happens behind the scenes that is completely transparent to you. After all this stuff happens, things settle down and run smoothly again but for heavily loaded avatars it can take several seconds for things to calm down. Meanwhile, everything else in the sim will stutter. This freezing behavior can be seen when testing in an empty sim using an unscripted observer and a heavily scripted test subject, monitoring the region statistics. See what happens when both heavily scripted versus unscripted avatars TP in and out. It may surprise you.

Each server only has a fixed amount of real memory (RAM) for each region running on it. Each script takes "some" memory, the more scripts running, the more memory used by those scripts and the less is available to "other" things the sim uses memory for. Once a sim runs out of real memory, it uses virtual memory, which is going to be a crappy desktop-grade SATA drive (cause they are cheap.) This causes the sim to lag horribly as it's swapping in and out bits and parts to and from the disk as needed to that Very Very slow storage. Once a sim starts swapping significantly, you pretty much have to do a restart (which is why I need to restart mine almost daily.) Scripts are not the only cause of low memory here, but they can be a significant factor in a busy sim.

There are some venues that will automatically eject people with lots of scripts. What they fail to understand is that by the time they count scripts on someone, it's WAY too late. The damage is done and the sim is already calming down to be only very minimally affected by the avatar's excessive scripts. I would NOT recommend those systems.

The bottom line though - if the scripts are in stuff in your sim, go for it. As long as they run smoothly, your good. Just be aware that things may start to behave badly when the laggies hit.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Sharie Criss said:

Once a sim starts swapping significantly, you pretty much have to do a restart (which is why I need to restart mine almost daily.)

In an excellent post, just this one bit is counter to my intuition, so I wonder if maybe something else is necessitating those frequent restarts. Either that, or the Mono engine must be leaking memory when scripts exit, but if that were the case, I'd expect the problems to be much more common in other busy sims, some of which continue to perform for weeks between scheduled maintenance restarts.

This problem of swapping used to be a really common problem years ago, and then it greatly improved. I've always assumed they just loaded up the RAM on the servers. Back in the bad old days, the swapping drastically affected performance of all sims on the same server host; I don't know if the virtualization is more strict now.

Share this post


Link to post
Share on other sites

I really wish the sims were better at that then. I like to hangout and build at sandboxes, (mainly the SL Beta sandboxes like bluesteel and letigre), and we regularily get people spawning objects that duplicate thousands of scripts, and the sim performance is systematically destroyed. It would be nice if there was some kind of limit to how many scripts can be run by one person, or how much sim "performance" that they can hog all to themselves...

Share this post


Link to post
Share on other sites

Well, a year late is better than not at all right?  LOL.  It is great to get that very detailed analysis of how lag works and how script time plays a part.  For the lay person like me though, we just want to know if script usage effects our SIM and the fact is, it DOES!  I am a witness to that!  I have owned several SIM's and the fact remains, once my regions script "Script Time" in my Statistics window aproaches 20ms, the SIM lags.  Now if I"m the only one on the SIM, not a big deal.  But the fact is, if I'm running my Club and I have even 7-8 people in my Club, it will LAG BADLY with a 20ms Script time load.  I don't really care that it's not directly caused by it or not, the fact is my region is impacted by it.  Likewise, I've operated my Tiki Lounge on a SIM with a script load of only 12ms and it ran pretty much LAG free with 14-18 people present.  So, at the end of the day, it DOES matter what your script load is.  As I'm building up my SIM, I ALYWAYS have my Statistics window open, paying attention to anything I rezz that drags down my free script time.  Anything that sucks more than 1 ms of free time, will NOT be rezzed on my land.  I have found that most static objects that have an average of 6 scripts in them (which is typical), won't even use 1ms of time.  So, anything over 1 ms in opinion was poorly designed objects and they get deleted from my inventory.  

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...