About Lag – By Kora

Last Updated: 16 October 2010
Second Draft

Different people will tell you different stories about lag and what is causing it.
Instead of boring you with the technicalities, it is easier if I set some limits.
Below that limits, you can be sure that you are not causing lag.

GOOD if:
– SCRIPT TIME is 0.350ms or below
– SCRIPT COUNT is 30 or below
– AVATAR RENDERING COST: 2000 or below

If it is higher, read the rest of the notecard 🙂

If you are found to wear laggy attachments, there is nothing to be ashamed or upset about.
You just have to contact the creator of the object and ask for a low-lag replacement of it.
Linden Lab is introducing limits on scripts both on region and on individual avatars, so becoming aware of your lag numbers (either low or high) is a necessity.

You will find articles out there saying that scripts don’t cause lag. Whoever thinks that is *delusional*. Sorry 🙂
Passive scripts are not to blame though (I am in favor of passive scripts).
Linden Labs changed the way the servers handle the scripts, and that is fine, but what happens nowadays is that if the server is overload by too many active scripts, it simply queue them , so instead of crashing the sim, your script will fail or timeout because  the server is busy running other things.

Server resources are limited and shared. So while you can run hundreds bad scripts in an empty sim without causing lag, you will almost halt the execution of any script if you move to a busy region. It is just a matter to be reasonable.

And to be honest, the responsability falls on scripters, ultimately (me included).

The numbers below are divided between GREEN, YELLOW,  ORANGE, and RED

If you are GREEN – it is VERY GOOD. You are very low lag and no need to worry any further
If you are YELLOW – it is NOT SO GOOD, and no matter what, you should at least find the source of the lag in what you wear
If you are ORANGE – it is BAD. You have to investigate, but if the traffic of the SIM is below 20 avatars, it is probably not a major concern.
If you are RED – it is VERY BAD. You definitely need to remove those attachments and/or ask me for help if you cannot identify them.

Again, no matter what, I will help you.

>>>> SCRIPT TIME  <<<<<<<
Only SIM managers can find out the script time. But this measure is *VERY* important.
If you receive a lag warning message from me, then please check on your scripted attachments.
Scripts do not cause lag. Bad scripts do.

Scripts with active listeners and timers and bad code in general cause enourmous strain on the server.
Resizeable or colorable high-prims attachments are generally the worst offenders, such as scripted hair or scripted belts and boots.
There are new functions in LSL to resize items with 1 script instead of 200 of them, so if you have one of these items, please contact the creator and ask for a low-lag replacement or a way to remove the scripts from your items.
Some hair designers added a menu to delete the resizer script once you fit on your avatar. Just create a copy of the hair before removing the scripts.

If the time dilation of a SIM is below 0.90, it is definitely caused by scripts.

(At the time being time dilation drops quickly when someone wearing Mono scripts enter the SIM, so quick and temporary drops of time dilation are not a concern, because there is nothing we can do about it).

The laggiest items in a SIM are AVATARS wearing scripted attachments, without any doubt.

Below 0.350ms: GREEN
0.350 – 0.550ms: YELLOW
0.550 – 0.800ms: ORANGE
Above 0.800: RED

If you are above ORANGE/RED, you definitely wear some badly scripted attachments.

What is the script time of attachments?
– Passive scripts are usually 0.002-0.010ms (all good)
– An average AO is about 0.070ms
– The SGS stuff  (HUD+Meter+Weapons) is about 0.080ms
– Some collars are 0.200ms (BAD!)
– Scripted Hair is often 0.600ms(BAD!)
– Some HUDs are 0.400ms (BAD!)
– Some scripted high-prim jewelry is 0.400ms (BAD!)
– Radars are often 0.400ms (BAD!)

Ask me if you want to check on your script time, and I will let you know.

>>>>>> SCRIPT COUNT (Phoenix only) <<<<<<
If you have Phoenix (or maybe some other viewer), you can find out how many scripts an avatar wears (it doesn’t count scripted items worn as HUD, but only worn as body attachments).

Below 30: GREEN
30 – 40: YELLOW
40 – 60: ORANGE
Above 60: RED

The SGS Meter has 4 scripts,  a SGS weapons (both items) is about 4 scripts max.
A large number of scripts is likely to cause ‘overload’ on the server, so keep it low.

If you have Phoenix, click on your ‘body’ and select ‘S. Count’ from the menu. It will show the number of scripts your avatar wear, or the number of scripts for that specific attachment, if you click on one of it.

If you don’t have Phoenix, ask a friend to find out the number for you.

>>>>> MEMORY ALLOCATION (Viewer 2.0) <<<<<<<<
I will explain this another time. For the time being it is not so accurate and not so meaningful, since scripters cannot allocate memory limits to Mono scripts.

Detailed information in here:

A high ARC affects the lag on the client side, so your viewer and everybody else around you.
When you have hard time to move or to rezz, even when time dilation is fine, it is likely lag on the client side.

To see everybody’s ARC, go in Advanced Menu (CTRL+ALT+D, if you don’t see it)
Enable Advanced > Rendering > Info Displays > Avatar Rendering Cost.

Below 2000: GREEN
2000 – 3000: YELLOW
3000 – 4000: ORANGE
Above 4000: RED

If your attachments are high-prim or use high-resolution textures, they are likely to be the cause of high ARC.
If not, read the wiki link above.

ARC doesn’t really compute anything precisely, but it is more an arbitrary number based on many variables.
If you keep it low, you cannot be wrong.


I  also support the decision of Linden Lab of setting some script limit.
If we scripters have to make an extra effort to tune the scripts to make them light on the servers, so be it 🙂

Again, if you are found to cause lag, do not take it personal.

Kora Zenovka