Difference between revisions of "Server architecture"
James Linden (talk | contribs) m |
Rob Linden (talk | contribs) (Added some notes from architectural overview) |
||
Line 19: | Line 19: | ||
==== simulator ==== | ==== simulator ==== | ||
The primary SL server process. Each simulator process simulates one 256x256 meter region. As the viewer moves through the world it is handled off from one simulator to another. It handles storing object state, land parcel state, and terrain height-map state. It performs visibility calculations on objects and land and transmits the data to the client. It transmits image data in a prioritized queue. Physics simulation is handled with the Havok physics library. Chat and instant messages are processed here. | The primary SL server process. Each simulator process simulates one 256x256 meter region. As the viewer moves through the world it is handled off from one simulator to another. It handles storing object state, land parcel state, and terrain height-map state. It performs visibility calculations on objects and land and transmits the data to the client. It transmits image data in a prioritized queue. Physics simulation is handled with the Havok physics library. Chat and instant messages are processed here. | ||
Running at full tilt, a simulator will run at 45 frames/sec. If it can't keep up, it will attempt time dialation without reducing frame rate. | |||
Simulators communicate with one another using a [[circuit]] via UDP. A "circuit" is a UDP network connection. Circuits are maintained between adjacent simulators. | |||
== Simulator vs. Viewer == | |||
* Simulator's job: | |||
** Runs physics engine | |||
** Collision detection | |||
** keeps track of where everything is | |||
** Sends locations of stuff to viewer | |||
** Sends updates to viewers only when needed (only when collision occurs or other changes in direction, velocity etc.) | |||
* Viewer's job: | |||
** Handle locations of objects | |||
** Gets velocities and other physics information, and does simple physics to keep track of what is moving where | |||
** No collision detection |
Revision as of 15:50, 21 November 2006
This wiki is mainly focused on the viewer, since that is the portion of the system that is open source. However, because the viewer interacts with the Second Life servers in somewhat complicated ways, it is helpful to have an understanding of what components do what on the server side.
Much of what you'll need to understand is actually covered in the protocol documentation. In particular, take a look at Authentication Flow, which outlines the process by which the viewer establishes connections with a number of components.
login server
CGI script running on login.agni.lindenlab.com. Handles verification of user name and password. Determines the login region based on home vs. last location vs. URL specified location. Finds the simulator process running that region and verifies user is allowed to connect there. Alerts the simulator to expect a connection. Informs the viewer of where to connect.
userserver
Historically, the user server handled login. Now it handles instant message sessions, particularly for groups.
spaceserver
Handles routing of messages based on grid x,y locations.
dataserver
Handles connections to the central database, log database, inventory database(s) and search database(s). Performs queries on behalf of the simulator process.
simulator
The primary SL server process. Each simulator process simulates one 256x256 meter region. As the viewer moves through the world it is handled off from one simulator to another. It handles storing object state, land parcel state, and terrain height-map state. It performs visibility calculations on objects and land and transmits the data to the client. It transmits image data in a prioritized queue. Physics simulation is handled with the Havok physics library. Chat and instant messages are processed here.
Running at full tilt, a simulator will run at 45 frames/sec. If it can't keep up, it will attempt time dialation without reducing frame rate.
Simulators communicate with one another using a circuit via UDP. A "circuit" is a UDP network connection. Circuits are maintained between adjacent simulators.
Simulator vs. Viewer
- Simulator's job:
- Runs physics engine
- Collision detection
- keeps track of where everything is
- Sends locations of stuff to viewer
- Sends updates to viewers only when needed (only when collision occurs or other changes in direction, velocity etc.)
- Viewer's job:
- Handle locations of objects
- Gets velocities and other physics information, and does simple physics to keep track of what is moving where
- No collision detection