Thursday, April 26, 2007

How Linden Labs becomes 'the next Google', by reducing lag.

This is the second article in a series. The first article can be found here

Lag in a sim is when time seems to slow down. Everyone is moving only very slowly. This happens because the server computer, the sim, cannot complete all necessary calculations within the allotted time. I have been trying to determine the causes of lag, but that is very difficult. Scripts can cause lag, that is for sure. But too many visitors seem to be able to cause lag too. At this point i suspect that maybe even the fact that some user in the sim has a very slow computer might affect lag.

Again we see something akin to the web. Sites used to go down because of their success. How ironic, you get so many visitors that the sim slows down to a crawl, so the visitors leave again.

But here the problem is more fundamental. I work at a web development company. Some of our clients' websites get hundreds of thousands of visitors per day. They have huge collections of servers, with load balancing, distributed databases and the lot, serving just a single website. The same should be possible in Second Life, a successful sim with lots of visitors might have dozens of servers backing it, while some other quiet sim might have only one.

Currently the system in place is pretty simple and intuitive (except for the separation between mainland and private estate, more about that later), tier fee is related to land, land is related to a sim, so you essentially buy hosting space, quite literally. Land can have only limited constructions on them (built of prims) and each prim can have only a limited amount of scripts in them. Each script has a maximum amount of memory it may use and the operations in a script can be executed only a limited amount of times per time unit, because of built in function delays.

I see two big problems.
The first is that if someone puts the maximum amount of scrips allowed in every prim on his land he can bring the simulator to a crawl. Worse is that people can wear prims on themselves, and have scripts running in them, bringing the simulator to a crawl even without owning any land there..
The second big problem is that if you have a successful sim, you might actually need those scripts to run, and the only way to get more computing power is to buy more land. But you can't share prims and scripts accross sims... Which leads to some peculiar constructions...


This is me standing in PokerPalace. Nothing peculiar yet, but wait until we check the map...



That is peculiar! Poker Palace is built at the center of 4 simulators! Most of the simulators are empty, apart from a small section in the corner of each sim. There is only one reason that the sim owner has built it this way: Lag.

This is a shame i think. The fact that the casino owner has to pay more to get more cpu power is no problem, but the way it is tied to the land is posing problems in scalability... Poker Palace essentially can't grow any further without having to set up a second casino... it already uses the maximum of 4 sims!

Now if Linden Labs could get that fixed, they would be one step closer to becoming the nex Google.

No comments: