Using VPS For Game Servers

Hey, slicehost looks cool. How do you like it? I think I might sign up. I’ve been freeloading my host on a friends server for nearly 10 years. :slight_smile: PM me your email address and I will enter it in the sign up form. After 3 months you’ll get a credit that is 25% of whatever slice I buy.

Well, before I fully commit to slicehost, does anyone else have an opinion?

FWIW, I want to host a server for my Android game. It is too early to do load testing, but it isn’t CPU, memory, or bandwidth intensive per game. I can say bandwidth is about 35 bytes per second per game. I guess the most important thing for me is I want players to have low ping. Slicehost is in Missouri, nearly the center of the US. Do you think this will sufficiently serve the US? Will other countries get total crap pings? My game is not super sensitive to latency, but it is more pleasant to have low ping. I need more testing, but I’d guess <250ms would be acceptable.

Edit: Chatted with Slicehost. They claim 60-120 ms from Europe, and generally much lower in the US. Of course lots of factors are involved.

Yeah, this looks quite cool for hosting game servers and lobbies. I don’t quite understand, though - do you need to send them your own box and then they plug it in? Or is the usual deal where you just buy one from them?

Are you sure that it means the CPU is running at 100% usage, or is it that out of your allocated resources (time, CPU, disc, DB &c) 100% is spent on the CPU?.

EDIT: Lol! Missed solution post!

@Nate my email is g.scov@hotmail.com. I like it alot so far. I have never run a server before or even used linux but i was able to get my server program up and running in less than a day. Everything is done through SSH, which was something new to me.

@Eli you just buy one from them. but it is virtual private hosting, meaning you share the box with other people but you have full root access.

on a side note, do either of you know much about linux? the server i have is running ubuntu 10.04. i need to run my java application and leave it running. so far the only way i have been able to run my program is through SSH. How do you start a java program and leave it running even when i am not connected through ssh? i talked to some admin at slicehost and they mentioned a linux startup script or something like that?

A great index of cheap VPS hosting is available through http://www.lowendbox.com/

I bought a VPS for £5.82 per month to try out some java Socket stuff…

I installed VNC & Gnome so that I could remote desktop to it.

Nate,
I use VPSlink link 2 ) for my games high scores (pomplets and hellevators) .
When I was writing Pomplets high score server, I was thinking in someday implementing a real-time online game, so I’ve written a small ping test for each client which connected to check/submit high scores . For each client, it logs the date, IP and latency of a simple ping-pong . If you’re interested in the raw data I can send it to you .

you can start you server using nohup .

for example :


nohup java -jar myServer.jar &

the & tell it to run on the background . (That is , the java console will not hijack you shell)

another option is to use screen , however I think it will be easier to just use nohup .

to check if your process is still running, type


ps -ef | grep java 

I’d also pick screen as it allows you to watch both STDOUT and STDERR without too much hassle.

To create a new, named console, type:
screen -S MyName

Then launch your application:
java -jar stuff.jar

You can detach from your console using:
CTRL+A+[u]D[/u]

To attach to a detached console, use:
screen -r MyName

To forcibly detach a zombie console, use: (this happens if your connection drops while attached)
screen -d MyName
then attach again
screen -r MyName

To launch your application when the server boots:
screen -S MyName -m -d java -jar stuff.jar
Put that line in /etc/rc.local

Note that this will launch the service with root-access, so read up on linux administration to fix that.

They allocate you some portion of a server’s CPU/RAM/HDD/bandwidth. The text on their site that talks about “your boxes are our boxes” is just trying to say they really care about customers, blah blah. They use 32gb quad core machines. They don’t say how much of one machine goes to a given “slice”, only that a 1024 slice has 4x the cycles of a 256 host. They do say that your slice can go over your allocated CPU usage if other slices don’t need it.

Wow, I didn’t realize you could do it for so cheap. While I don’t want to waste money, I also don’t require rock bottom pricing. $50USD/month would be fine if the extra is buying me something, with the ability to scale if needed.

Do you remember vaguely what the ping times were like? VPSLink looks acceptable. It is slightly cheaper than Slicehost. Slicehost has better marketing toward developers.

thanks riven! screen is awesome! just what i needed.

[quote]How do you start a java program and leave it running even when i am not connected through ssh? i talked to some admin at slicehost and they mentioned a linux startup script or something like that?
[/quote]
you ask some linus admin , do I miss something ? already mentionned but… once again in all linux/unix command line prompt you can run a program in backgroung using “&” at end of line

[quote]prompt >> java -jar program.jar &
[/quote]
can someone point me the interrest of using anything else than “&” ? (that’s a real question …)

You might be interested in stdout/stderr for simple logging / dumping / debugging.

Sure, you can dump those streams to a file, but then you have two files. You can also interleave the two streams, and write it to one file, and you’d have to ‘tail -f *.log’, but then you wouldn’t be able to figure out which line belongs to which stream.

In the end, you (probably) try to reproduce the eclipse console: interleaved stdout/stderr, and that’s exactly what you get with ‘screen’ (without the scrollbar)

thanks Riven (to be honest, still try to understand everything right but anyway I am sure that if those programs exist they must have an interrest)

as you mention basic 1>stdout.txt 2>stderr.txt and tail -f have always been fine for me

Also, you can hit CTRL+C, sending the term-signal to the process.
Further, you have command-history per console, for a quick restart, or for changing the parameters.
IMHO its just easier, no messing with pids, just one console per application.

Wow, this has turned into a wonderfully informative post. I’m keeping this bookmarked so that when I do all this in the near future I have a nice collection of information.

Is there a way to run Ruby on these boxes? And if everyone gets access to root, how do I avoid someone messing with me and deleting my initializer scripts?

Think of a VPS (virtual private server) as a piece of a harddisk, a piece of ram, a piece of CPU, all isolated from eachother. A (true) server that has X VPS’s running, has X operating systems installed and concurrently running. It might even be linux/windows/dos on the same hardware, all thinking they have exclusive access to hardware, while everything is emulated (with marginal overhead).

Hi, I used to have a Slicehost server with 512 MB of ram as a development server, used it for hudson, nexus, svn, trac, and some static content.

The main problem always was the amount of ram, as soon as you start using swap the server just becomes way too slow to be useful.

We eventually changed from Slicehost to Linode because of the ram issue. Linode offers twice the amount of ram for the same price. If the situation was a temporary thing and there were any plans to improve the price in slicehost we would have stayed, as the service is excellent, but if you read their forums they have said that their focus is on big clients who need the ability to rent a lot of servers in a short time, and stuff like that. We had the server in slicehost for years, and the amount of ram was the same for the price we paid, no improvement in the ram/price.

hope this info helps.

Of course, I have no affiliation whatsoever with slicehost, or linode other than having used their service.

you can see the latencies I collected here . . I have disable the latency tester after a few days so that’s why you just have some days . The IP is in the format describe here so you can see which country it belongs .

Thanks teletubo!

And thanks ruben01 for pointing out Linode. They have cheaper bandwidth overages, list how many nodes are on each machine, and best of all, have a datacenter in Europe. Sweet!

I had a Linode for a year, very happy with them. The admin gui is very nice.