• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
EternityZA

Real time game servers on a VM on your dedicated server.

6 posts in this topic

Hi.

Some time ago I had an issue with my FPS having constant lag spikes when played online. With hplus's help i figured out it was because I was hosting the server from a rented VM. The lag spikes went away when I moved the server to a rented dedicated server (because of "time slicing" or w/e it was called)

Now its still happily running on my dedicated server along with a few other servers. But with all my tinkering my centos installation is becoming messy. So i was thinking of creating a couple of VM's on my dedicated server since VM's are easy to backup and I cant break my entire server taking everything offline (including my website) in one go. This has happened recently :D. However this of course takes me back to my original problem...

My question is. Before i start setting up VM's (wich will probely take me a while like everything else i attempt in linux) Is there a way for me to make a VM run in "real time" so it can host real time game servers just as well as Im currently hosting it. If theres not then I probely wont bother with the idea of VM's.

Thnx in Advance!
0

Share this post


Link to post
Share on other sites
a good VM solution should let you dedicate one or more cpu cores entierly to the important VM(s) and that should prevent most issues. (The big problem with cheap virtual hosts is that they squeeze in multiple VMs per CPU core with the assumption that they won't all do heavy work at the same time, a single VM can then fully occupy multiple cores for short periods of time to get through a piece of work quickly which is great when you primarly host for example webservers but really awful if you also host things that need the CPU all the time (such as a gameserver).

In your case i'd recommend dedicating a few cores to the important VMs (The game servers) You could possibly run multiple gameservers per core but things like the webserver VM cannot be allowed to borrow the gameserver cores. (If the webserver gets hit by heavy traffic it should slow down, it shouldn't steal from the gameservers)
1

Share this post


Link to post
Share on other sites
Note that, even with dedicated cores and RAM, the VM will have a higher scheduling jitter than "bare metal." If your game is action oriented, you may have to run the actual game server on bare metal, and perhaps you can move the other servers to VMs?
If the needs are only "soft action," and/or you can compensate for jitter with increased lag compensation, then it's possible to run the game server, too, as a VM, with dedicated resources, but it just isn't as optimal as bare metal according to what I've measured.
2

Share this post


Link to post
Share on other sites
[quote name='hplus0603' timestamp='1346084653' post='4973818']
Note that, even with dedicated cores and RAM, the VM will have a higher scheduling jitter than "bare metal." If your game is action oriented, you may have to run the actual game server on bare metal, and perhaps you can move the other servers to VMs?
If the needs are only "soft action," and/or you can compensate for jitter with increased lag compensation, then it's possible to run the game server, too, as a VM, with dedicated resources, but it just isn't as optimal as bare metal according to what I've measured.
[/quote]

This.

Anything requiring decent CPU resources from a server is going to suffer [b]badly[/b] on a VM. Hypervisors just aren't quite as great as we'd all like them to be. Scheduling can jitter very badly, and additions of CPU features like hyperthreading can make VM performance even more flaky. If you really are CPU heavy on a game server, run bare metal.

Support/auxiliary servers (such as login, rankings, web pages, etc.) can all handle VM jitter pretty effectively, so they'd be my first candidate for offloading.

Also, a good host should have a way to image your dedicated server directly, so you might look into that.
1

Share this post


Link to post
Share on other sites
Though choosing the "right" virtualization technique (what's right, and what's wrong?) should be able to avoid this scheduling jitter.

OpenVZ and more recently LXC do virtualization simply by using [font=courier new,courier,monospace]chroot [/font]and by putting processes in each "virtual machine" into a separate namespace. It is not "real" virtualization, if you want to look at it that way, but in my opinion, this is virtualization [i]how it should be[/i].

All processes on the machine run from one scheduler, they all pull their memory pages from one pool, they're all running just like on one machine. Except... they're isolated by their namespaces and jails, and you can give them quotas (if you want). No emulation crap, no obscure hacks, no overhead.

Of course, a malicious process subverting (or even crashing) the kernel will affect all virtual machines, but who cares. When it comes to that, you're kind of lost anyway. Edited by samoth
1

Share this post


Link to post
Share on other sites
Like other's have said, running on the host OS will give you the highest performance and thinnest margin for latency and throughput variance, but the biggest problem for your initial contact with VMs is probably that your VM provider was over-subscribing their host machines (say, putting 20 VMs on hardware that only *really* could support 12) on the assumption that not everyone is going to be doing heavy-lifting at once. The other issue, also mentioned, is that VMs are "usually" optimized for "bursty" workloads -- Ones that go through brief periods of intense work, rather than a constant load of moderate to heavy work -- often times they're only guarantee you the equivalent of a few-hundred megahertz, but allow you to burst to several times that when resources are available to make up for it. It's a perfectly acceptable strategy for latency-tolerant activities, but bad for things that need a latency guarantee.

I don't think it would be a wasted effort to experiment with hosting the game on a VM on a platform that you have direct control over, it might work out better and if the management benefits are worthwhile it might be worth taking a small performance hit. I'd imagine there must be a way to do it, because there are hosts that are optimized for gaming, and I can't imagine that's a manageable/profitable business without virtualization.

For what its worth, most bigger games separate out a lot of the sub-systems involved in getting into an online game -- login, match-making, load-balancing, purchases and persistent storage are the typical candidates. These all serve as the front and back-end to instances of the game server running on real hardware. Note also that you can run several *game instances* on one physical machine, just make sure to insulate them from one another so that if one goes down, they don't all go down (assuming the one that goes down doesn't take out the kernel itself). Edited by Ravyne
1

Share this post


Link to post
Share on other sites
Thnx for all the replies. Im going to start by moving web+email server to its own VM and il create a "sandbox" VM for messing around with. Il keep my gameservers + database on the bare metal for the time being. Not 100% sure about database since its being used by gameservers and webserver but my gameservers never "need" realtime database access. If theres a delay in database requests it would have no impact on the players so maybe I can move the DB to the webserver+emails VM as well. Although at this point it probely gets a little case specific and ill have to experiment :D

Thnx for all the help! Edited by Wilhelm van Huyssteen
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0