Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Limit Number of Scripts to REDUCE LAG

Mark Gjellerup
Too Much Gjellerup!
Join date: 20 Mar 2006
Posts: 35
06-12-2006 12:09
Hi, I'm new to the forums, I joined SL in April 06.

I was going to make a proposal to limit the number of scripts, but I already found it:

From: someone
No one enjoys limitations, though they inspire creativity. We are limited in the number of prims we may place on a parcel of land, let's also limit the number of scripts as well. This could benefit those residents in mainland sims from being at the mercy of their neighbors possibly high active script loads on server resources. The system currently now allows a person owning 512m2 of land in a sim to deluge that same sim with a virtually unlimited number of active scripts, which could hamper the other residents of the same sim. Let's base the number of scripts allowed on land in a similar fashion to prim use, for the better balance of sim resources.


Lag has personally affected me because my sim now has over 2,500 active scripts. Over 2,500 running scripts and a total of 3 people are in the sim! :eek: I like to script things inside my home, but I'm having more and more trouble because everything is running slow.

Most of the sim's scripts are dormant, but thanks to Lex Neva we know dormant scripts cause lag.

In addition to the script limit proposal, it would be nice to do a script count on each parcel of land. So if someone had 500 active scripts on a 512 land parcel, neighbors would know who's the idiot causing lag.

As for the official rules, let's say I own 1/64th of the sim... maybe I could have 1/64th of 2500 scripts. That means I could have 39 active scripts on my land. I don't think attachments should count. The problem in my sim is people are running scripts but NOT USING them, attachment scripts are atleast being used. The sim could check every 30 minutes or to see if I have exceeded the limit of scripts on my land, and when I cross the limit IM me "Some active scripts will be turned off if the active script count is not reduced on your land in the next 5 minutes."

Every script should also have the ability to be assigned a priority from 1 to 10 by the owner of the land. Priorities are needed because people will want their vendors to stay active no matter what. Also if some guy in an airplane with a 100 scripts flies over my land, I don't want the scripts on my land to turn off... I want his scripts that don't have high priority on my land to turn off (he would have to hover 5 minutes before that would happen).

Now I'm just throwing out ideas, but something has to be done to limit the insane number of scripts in each sim... even if it's not a script-priority based system.

Please vote 'Yes' on the basic script limit proposal. It will help the Lindens take serious action to stop sim-lag.
_____________________
Seronis Zagato
Verified Resident
Join date: 30 Aug 2005
Posts: 454
06-12-2006 13:44
No sorry. I'm some cases by spreading functionality out amongst several scripts you can write them in more effecient ways so that less resources are used overall. Scripts can be written in MANY different ways and although im a full advocate of placing limitations it is always in very specific manners that have measured effects where the benifits are rare and the problems removed is the VAST majority. Check my religeous posts on channel zero issues and you'll see how adamant I am about effeciency.

But strictly limiting scripts by number will REMOVE the ability to actually do things more intelligently. So I can not place my vote on anything that takes this stance. Try to research methods that effect specific problems rather than broad suggestions that can do as much harm as good.

Dropping script numbers is equal to just banning all Tori prims even though using a single torus is fewer polygons than the combined polygons it would take to make the same shape with other prims. Not to mention that using the multiple other prims would require the extra overhead of size / positional data to be transferred.

Sadly I'm also against adding in time slice distribution based on land ownership. If every script that is already processing had to ADDITIONALLY now start doing lookups based on its owner comparing to the ratio of all other scripts queued in the sim to see who has earned X timeslice and (etc etc etc) that would have the reverse intention of slowing things down further because of the truely massive administrative work required to impliment the failsafes.

Right now scripts in general get a certain timeslice of the SIMs total processing so that scripts as a whole doesnt have as much effect on simple movement, communication between avatars and basic building. Extra layers of timeslicing beyond this would only reduce the ammount of work currently being allowed to process.
Mark Gjellerup
Too Much Gjellerup!
Join date: 20 Mar 2006
Posts: 35
06-12-2006 14:56
From: someone
some cases by spreading functionality out amongst several scripts you can write them in more effecient ways so that less resources are used overall.


I disagree. More efficient for your product maybe, but less efficient for the server. I know Jesrad Seraph's multi-move script and some others use the multiple scripts to get around time delays of calling functions. Other scripts mentioned in Lex Neva's post use hundreds of scripts to all give an object one big push simultaneously. The scripts are useful, but let's call them what they are... hacks to get around a system that is already being pushed to the limit.

People who aren't even using the scripts when no one is on their land, are slowing down everyone else's in-world experience. If an object on someone's land has 100 scripts in it, each one of those scripts has to be checked for events everytime the server updates. If someone left 100 scripts active on their land when they are not online, they should be turned off. Note that the only reason I endorse these harsh measures is because of Lex Neva's post. If dormant scripts didn't lag the server, there would be no problem.

The scripts wouldn't have to look-up anything so I don't think my plan slows down the server. It would be an algorithm on the server that goes one-by-one to each piece of land. It would have to look up priorities and mark some scripts for deletion, but the load on the server would be minimal. Like I said before each user could give each script key a priority. What would happen is the server would get all the scripts on someone's land, by looking first at which objects are on land, like the About Land tool. If there are extra scripts, it would sort the scripts by user's given priority (no priority means a default priority is given), and mark the X extra scripts for de-activation. It would send an IM to notify the user. Then it would de-activate (not delete) any script keys marked for de-activation after 5 minutes. If the scripts marked for de-activation are no longer on the land (like an airplane flying by) nothing would happen.

If the server checked a parcel of land one at a time, checking each piece every hour or so it wouldn't hit the server hard at all. It would be similar to a user walking through the sim and selecting "About Land" to look-up all the items. My version of the proposal doesn't affect attachments. I just want Linden Labs to clean-up for people who keep untidy laggy houses, because it affects other users in-world experience.

I agree things like listening on channel 0 and other horrible practices need to be minimized. But the reality is that when 2500 or more scripts are running, even if they are empty, the server takes a hard hit. We need limits.
_____________________
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
06-13-2006 03:34
Well, simulators already reduce script-time based upon the server FPS (more lag = slower script = less lag). Someone else posted a while back that the logical progression would be to have this done on a per parcel basis, ie the more of the sim you own, the more script time you get so say the server has 15000 units of script time, then a 1024m plot of land would get 234 units of script time. Those numbers are pulled right out of my ass, but people already know the prim limit system so it's easier :)

Anyway, if the scripts in your plot hit that limit then they slow down. This would prevent small plots having a ridiculous quantity of scripts doing a lot of processing all at once.

The problem is that this may be complicated to implement, though with some sensible delays to when it recalculates and such it might not be so bad. I'd probably also have it allow for 'spikes' by letting you use up spare script time units, but moving you down toward your parcel's limit, allowing scripts to do a lot of processing for a short time then sit dormant.

Multiple scripts don't mean more lag, which is why that limit is not very workable. A single script can cause a lot of lag by opening a lot of listens and performing loads of list operations on them, or doing big loops or whatever. While a few small scripts could spend most of their time dormant (in fact, most extra scripts do precisely that as they are for data storage, or providing functions you only need every now and then).
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
06-13-2006 11:13
I'm very much in favor of some system to limit the number of scripts in a sim. It's true that (ideally), adding more scripts to a sim results in each script getting less of a timeslice, while the rest of the sim is unaffected. However, that means that with a huge number of scripts in a sim, any scripted task takes forever and a half to complete. I also have to wonder if the scheduling system is really as wonderful as it tries to be, or whether sometimes it might slip and take too much time processing scripts if there are too many in the sim.

The big problem with this kind of limitation is that avatars tend to be the single biggest source of scripts, in my experience. Often, they use hundreds of scripts each, and I've seen single avatars in my sim with more than a thousand scripts in their attachments. My sim floats around 500 or so scripts (we've got a lot of active effects and are very careful to ration our script use), but when a crowd visits, the sim can peak up near 2500 scripts.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-13-2006 11:48
Someone else posted a while back that the logical progression would be to have this done on a per parcel basis, ie the more of the sim you own, the more script time you get so say the server has 15000 units of script time, then a 1024m plot of land would get 234 units of script time. Those numbers are pulled right out of my ass, but people already know the prim limit system so it's easier

Yep, this is a great idea... though you probably want to run this in "overcommit mode" or else nobody will be able to script anything on a First Land even if most of the sim is empty.

Also: don't apply parcel limits at all unless the sim script time over (say) 10 ms per frame.

And don't count attachments or active vehicles in the parcel limits (like you don't count them in the prim limits), or you'll get people freezing and jerking across the sky even worse than they do now as they fly over different sized parcels.