GD Hardware
From Gamedev.org wiki
| Table of contents |
|
|
Game Development Hardware
This is intended as a very basic overview of the hardware required to develop and run a small-scale MMO (yes, I know, it's a contradiction), followed by suggestions on upgrade paths in the event of success.
Dispelling the myth
Developing software is not an easy or brief process, but one thing people fear more than necessary is the hardware factor.
As an independent game developer, the possible scope of your projects is unlikely to necessitate the kind of hardware you'll hear about from major players -- you simply don't need a server farm for development. You probably won't even need a server at all until you reach the point where you want your application running on a dedicated machine.
You do not need two machines to write or test your server-side application. Connecting to your server application can be accomplished by running it on your development machine and, from the same machine, connecting to your own IP address, either from the command line or using your client application. This should cause your request to be routed through your ISP, so even though it will come back to the same computer, it should behave just as if it were a request from a different computer. Note that you may need to configure your router/firewall to allow connections on whichever port you decide your application will use for communication.
Development hardware
Development of your server-side application will be more difficult in the sense that you will be building most of the actual mechanics of your game; however, it will be simpler in the sense that you do not need to implement any graphical interfaces unless you choose to (text-based tools to monitor your game in real time will sap less resources that could be used by your players). In the latter sense, server development doesn't require much at all in terms of hardware.
The most hardware-intensive task you'll undertake as a developer will probably be testing your client-side application. For this, you'll basically need a machine a little more powerful than you will require for players to run your game client (slightly more powerful only because you will certainly be running unoptimized code while you're developing).
Hardware for Game Servers
Hold off on the server farm
Those of us who develop on our own -- or even as part of a small team -- do not have the hardware needs of a commercial MMO. While you may not want your game server software running on your PC while you're playing it yourself and running five applications in the background, chances are you won't need a state-of-the-art, multi-CPU monstrosity to efficiently run your MMO.
Unless your user base is significant and your server-side game software is CPU-intensive, your dedicated server probably doesn't need the latest dual quad-core rig you can put together. Before you consider new hardware, there are a few things you can do to dramatically improve the efficiency and responsiveness of your server-side application without changing your hardware -- most of which are design considerations, so plan ahead!
- Environmental Considerations
- Choose a server operating system with excellent thread handling (and ensure that you're taking advantage of it).
- Review your shared resources carefully to ensure that locks are released as quickly as possible.
- Bandwidth and Processing Time
- Leave all non-critical information processing (particularly graphical elements) to the client application.
- Ensure that you are passing only necessary information between the client and server.
- Database Bottlenecks
- Limit file and database access as much as possible.
- Consider database software with row-level locking, particularly if your server application is database-intensive.
- Stored procedures can help cut down the time your server spends preparing database queries.
The T1 can wait
As mentioned, there are various ways in which you can protect your server from processing overload -- some of which can also serve to reduce your game's bandwidth utilization, which should be a major consideration if you want your game to scale well to a large player base (without breaking the bank on ridiculously expensive high-throughput lines).
Eventually, if your project takes off, you'll probably want to consider either colocating your server or putting it on a dedicated line to increase its upload potential. Depending on your server application's CPU and memory requirements, increasing your available bandwidth could potentially end up being the first upgrade that will really help your project.
Upgrading
So your project has taken off! Congratulations! Your server is struggling to support 20 users at any given time, your ISP is starting to wonder what your problem is, and/or your brother came back from college and wants the RAM you took out of his computer back. What comes first?
Identify your bottleneck
It's always tempting to just go build a new box. There's always a hot new processor out there, faster RAM on a better board with a newer, lighting-speed SATA 95.1 and terabit ethernet on a brand new T1 line -- but don't fall prey to this train of thought. You could waste a great deal of money and find that you haven't even solved your problem.
Presuming you made the right choice and developed your server application for some flavor of Linux (that's a joke... mostly), there's a very basic utility called 'top' that will show you how much of your resources are going where. In Windows, you can use the system monitor to view your active processes.
The first thing to consider, as you might have guessed, is finding your bottleneck.
- If your CPU is pegged all the time and your RAM usage is hovering around 1%, that new DDR55000 isn't going to help.
- If your CPU is taking a stroll around the board waiting for some RAM to be freed up, that Core Duo is not what you need.
- If your RAM usage and CPU are both quite leisurely, it's time to get off mom's 56k line.
CPU Considerations
If you find that your server application is burning up your processor, figure out what exactly it's doing. If the only processes eating all that memory are running your game logic, then (perhaps after a review of that logic to make sure it's as painless as possible) you may need to look at upgrading your processor.
If, however, you find that it's your database software that's holding everything up, it's time to look at your configuration and choice of engines to ensure that you're allowing it enough of the resources it needs while giving it every opportunity to quickly and efficiently manage your data. A major consideration here is how often you use the database: Storing information that isn't likely to change rather than querying the database for it can take a lot of the burden off of your DB, as can limiting the frequency of table updates. If your server goes down and players lose their last two minutes of game time, you probably won't have a mutiny on your hands; however, if players are consistently unable to play due to lag issues (but your database always has everything backed up right to the second), you may be dealing with unhappy people.
Once you've decided to plug in a new chip, consider whether you can upgrade in your current socket; if you can, make sure you won't be upgrading again when you've gained ten more players.
- Multi-core processors can provide a lower-cost upgrade path for those of us who can't shell out thousands on a multi-CPU server.
- Processors which perform well on multiple threads will help you more than those whose strength lies in single-process number crunching.
- A higher motherboard memory bus speed will ensure that your processor is using your resources as efficiently as possible.
Memory upgrades
Unless your application is handling files or performing some extraordinary AI calculations, RAM will probably not be your first problem. However, if you do find yourself with a memory deficiency, it's more likely that you'll be able to upgrade without installing a new motherboard.
- Ensure that your system is properly recognizing your RAM; a new chip can't use a dead socket.
- New RAM should use the fastest possible bus speed your motherboard is capable of.
- If you know the timings of your current memory, try to find memory with lower timings.
- If your board can take advantage of DDR, ensure that you are using matched chips in the correct slots.
- Ensure that your operating system can handle the total amount of RAM you intend to use in your machine.
Desperate Measures
Rebuilding your Server
If you're past the point of no return and you can't put a sufficiently powerful CPU in your current server (or your old 486 just won't accept any more RAM), it's time to plan a new computer.
- Remember where your bottlenecks are and plan for them.
- If your application uses 100% of your Pentium III and only 50MB of RAM, don't waste your money on 8GB of DDR800.
- If what you need is more RAM, invest in a motherboard that has a large, even number of DDR slots.
- Think ahead based on your current usage.
- Current motherboards often come with integrated gigabit LAN ports. There's not much reason not to go for this one.
- If you're upgrading your processor, try to pick a socket type that will offer you further upgrades if you need them.
Bandwidth Solutions
If colocating isn't a viable solution for you (and I'm sure that's the case for most of us), it's time to think about upgrading your home internet connection (or finding a separate one on which to run only your server).
Stop right there! Before you do this, there's something very important for you to check out, and it could save you a great deal of time, money and frustration. Think your bottleneck is your internet connection? You may be right, but if you're behind a router, you may be in for a nasty surprise.
Routers with internal switches are extremely common. Linksys, D-Link and various other companies produce these accessories to make home networking affordable and convenient; however, they often introduce a very nasty limitation that most people aren't aware of. The actual throughput of many routers is drastically lower than advertised; I have seen internal transfers on a 100Mbps Linksys router maxing out at or below 30Mbps; unfortunately, this is a common problem.
- One solution to this is to find a router that doesn't have these problems (be sure to check into it thoroughly) which can also use your entire available WAN bandwidth (be sure to check your modem's specifications on this point as well).
- Another solution is to build a router out of an old PC (even a 486 will work) and running a Linux installation built to function as a router (I use SmoothWall Express for this; it has a web-based configuration interface similar to that of a LinkSys router).
Also, if you chose Windows as your server's operating system (ouch), you may find that Windows itself is slowing you down. Its internal TCP/IP implementation can perform extremely poorly for a variety of reasons; if you can, test your network's LAN and WAN bandwidth using a Linux operating system to see if this may be contributing to your problem.
If none of these fits the bill and you really do need to get a faster connection, you have options.
- If you're on a cable connection, your ISP probably offers tiered access (something like 7 and then 9 Mbps).
- If DSL is available in your area, you can look at getting a dedicated line.
- If you are looking at DSL, ensure that you are located close to the hub, or your performance will suffer.
- Make sure your connection offers a high upload rate, as your server probably needs more upload than download.
- If you're rich, opt for a T1!
Multiple Machines
Popular MMO's often tout acres of computer hardware -- and they certainly need it! However, these server farms support hundreds of thousands of players concurrently. Unless your success is truly impressive and you're actually bringing in money from your venture, running more than one game server probably is not something you will want to do.
Running more than one machine brings with it several questions and the need for not just one but at least two more computers than you're currently working with -- and that number will grow depending on whether you intend to keep just one instance of your game world going.
Round Robin
A minor consideration is this: Which server do you put people on? If you are running just one game world, then it won't matter, as this decision will be made based on load balancing (i.e. when a player logs in, you send him to the server which is currently handling fewer players). If you're working with more than one game world, then whichever machine is hosting that world will be the one the user is sent to.
Both of these scenarios, however, require either a separate machine to delegate users to servers, or a separate piece of software running on one of your servers, consuming precious cycles, performing the same function.
Multiple Game Worlds
If you don't mind hosting more than one instance of your game, then this will be relatively painless; your problems will involve such things as which users to send to which game world (server) and how to assign new players to one or the other. Aside from the extra logistics of running more machines, this solution brings very little overhead compared to the alternative.
Single Game World
If a single, unified game world is your goal (and it's probably what you've been working with anyway), you are presented with more problems.
The greatest of these problems may be the fact that you now have two machines which need to access and update the same data. What this means to you is that instead of two computers running separate instances of the same software, you must now reconcile two systems which will work on the same data in real time.
You must either choose one of the servers to run the database for both, as it would be nearly impossible to synchronize your game databases between two machines in real time, or build a completely separate machine which will function solely as a database server. The latter is a better choice in terms of retaining the ability to load-balance your game servers and to effectively host your user base; however, it obviously requires the creation and configuration of a new server, for which you will need to consider very different factors than you did for your game servers.
It also requires modification of your server application -- and if your database functionality is mixed in with your other code, this could be a very significant task. Unless having a unified game world across multiple servers is something you plan for from the beginning of your project, it could become virtually impossible depending on your code.
Summary
You can develop both a client and server application simultaneously on one machine, and you don't need a beastly, bleeding-edge box to run your homemade MMO (at least, not at first). If you manage to cultivate a following for your game, you should consider your upgrades carefully and in the context of what your game requires, and if you want to plan for your MOG to be truly massive, you will want to build your server-side applications accordingly.
The hardware side of independent game development doesn't have to be scary, even for entry-level programmers and designers; understanding your application's requirements will enable you to analyze your hardware requirements and upgrade with the kind of thrift you'll need to keep your independent project afloat.
phu 03:37, 11 Jun 2007 (EEST)
Categories: MMORPG | Advice | Hardware | Networking

