Tips and Tricks: Dealing with Lag

The commonest thing I see in chat during Hair Fair (and often elsewhere) is "OMG The LAAAAG!!! I can't move!!!"

But the word "lag" is this very nebulous thing – it's more an effect than a cause, and the word is often used to mean lots of different things. So here, I'm going to explain a little bit about lag and what you can do to improve things a bit.

First of all, you need to activate the Advanced menu, if you haven't done so already. To do this, hit Ctrl-Alt-d. You only need to do this once; once open the menu will be there every time you log in (until next time you update your viewer).

Lag1  Lag2  

Next, you will want to open two very useful tools that will tell you something about the possible cause of any lag you might be experiencing. These two tools are the Lag meter and the Statistics panel and they are both found under the Advanced menu > Performance tools, as shown. (Click the thumbnails above to open full size).

Let's look at the Lag Meter first (Pic 2).  This one shows "traffic lights" for three possible causes of lag. basically, green is good, amber means running below optimum and red is bad. These scores are shown for three separate things: client, network and server.

Client is your computer, your viewer. If this is consistently red it usually means that your graphics settings are too high, or your computer hardware is not good enough. This will manifest in such ways as textures taking a long time to "rez" – objects appearing grey or blurry for a long time, sculpty objects remaining as spherical lumps instead of resolving to their true shape, animations being jerky, etc. You can help here by going to your Preferences (Ctrl-P or Me > Preferences), clicking the Graphics tab and knocking the graphics slider to Low. If you click Custom you can tweak things more specifically, for instance lower the draw distance, turn off Atmospheric Shaders, etc. Basically, turn everything as low as you can cope with, and then try turning things back up one by one to see how high you can go before the lag is a problem again. I'll talk more about Preferences settings later.  If you're getting persistent client lag and your graphics settings are already as low as they can go, then I'm sorry but you're going to need a hardware upgrade if you want to enjoy your Second Life experience. SL requires a GOOD computer, and most laptops, especially ones with on-board or Intel graphics cards, just can't cope.

The next item on the meter is Network, and this is the one that is usually poor for me. To put it simply, Network refers to the traffic between you (the client) and the sim your avatar is standing in (the server). Every time you move or do anything, information is passed, via the internet, from one to another and back again, and interruptions to this flow will cause lag. A typical symptom of network lag is "rubber-banding" – when your avatar is walking fast but moving slowly, as though pulled back by a rubber band, also you may find you walk and walk in one direction and can't stop or turn around, then as the connection improves you "snap" back to where you were before.  The commonest cause of Network lag is trying to play Second Life on a wireless connection. If you're trying to do this and the Network light is persistently red, don't. Get a network cable and sit closer to your router. You may also have problems if there are other computers on your home network also accessing the internet at the same time, or if you are simultaneously streaming media or downloading/uploading. Some other causes are beyond your control; Network is usually poor for me because my local infrastructure isn't great, and I'm a long way from my nearest telephone exchange, so my broadband speed is slow. Short of moving house, there's not much I can do about this. But you can get a rough idea how good or bad your internet connection is by checking your broadband speed on a speed test site. If it's below about 1500kb/sec then you're going to struggle.

The last item is Server lag, and this is the one that depends on everyone helping out. The server is the region you're standing in and lag here is caused by a few factors: many large textures to be loaded, many scripts (or poorly-written scripts), many avatars in the region (all carrying their own attachments and scripts), and physical objects such as vehicles or moving animals.  Server lag is reduced by efficient building, by using fewer and smaller textures, by using fewer and better-written scripts, and by avatars stripping off their scripted attachments (or even all attachments). If you are at a place like the Hair Fair and experiencing server lag, as I was here, you can help by removing all your attachments whether scripted or not. This includes hair, shoes, jewelry, face-lights, and also HUD items such as your Animation Overrider.

You may also see people at events like Hair Fair talking about "Avatar Rendering Cost" and this is a feature also found in the Performance Tools menu. I advise ignoring it, as it's not an accurate way of measuring how laggy an avatar is; it measures only prims and textures but it doesn't count scripts, and it is quite misleading. A very  low score is always good though, because you can't get low without taking everything off. Ironically, the Avatar Rendering Cost feature is itself heavy on resources and is itself a cause of lag.


Finally, let's take a look at some of the key parts of the Statistics Panel. I've highlighted some items here.

#1 FPS: This stands for "frames per second" and is a measure of how often your client is re-drawing the screen. If your score is above about 25 then you're doing absolutely fine, this is about the same frame-rate as television. At under 20 the movement and animations may appear a little jerky and not so smooth. Below 10 and it gets very jerky and if the number drops very low it may be impossible for you to move at all. (Or, rather, you are moving but your screen isn't re-drawing so you don't see yourself move). FPS is mainly client-side and can be improved by dropping your graphics settings lower and by turning off Anti-Aliasing. You will also take a FPS hit if you have altered your UI side to be anything other than 1.00.

#2 Bandwidth. This measures how busy the network is. If you are constantly maxing-out you may need to raise your bandwidth in Preferences (Network tab) but it cannot possibly be higher than your total broadband speed, which you measured earlier on that speed-test site. If Bandwidth is dropping to zero, this means that your internet connection is unstable and you are losing connection completely. In this case you may need to call support for your Internet Service Provider.

#3 Packet Loss: This is related to Bandwidth. Data is sent across the network in "packets" and this statistic measures how many of those packets go missing in transit. It should ideally be zero; a score of up to about 2% probably won't be significant enough to even notice but at higher numbers you will find such effects as prims and even terrain not rezzing. You may also have difficulty moving and have the "rubberbanding" effect I mentioned before. If your packet loss is consistently high you can improve it by lowering the bandwidth setting in Preferences.

# Sim FPS and Time Dilation.  Ideally the Sim FPS should be at maximum which is 45, and Time Dilation should be zero. This means that instructions to and from the sim are taking exactly as long as they should. Time dilation means that things are taking a % of time longer than they ought to, and as this number rises, Sim FPS will fall. As Sim FPS falls, moving gets difficult (if not impossible). It was down to 13 at the time I took this snapshot in the Hair Fair and I could barely move at all. This is basically a measure of Server lag; too many textures, too many avatars and too many scripts in the region. If it is persistently low in a sim that is not overloaded as Hair Fair was, it can generally be helped by a Sim reboot, which has to be arranged by the owner of the sim.  But at Hair Fair there isn't really much any individual can do, unless you can persuade everyone else to take off their bling.

So hopefully now you have a bit of a better idea of how to identify the cause of lag and what steps you can take to improve it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s