Thank you for this guide. I'm using it for my server now.
I'm running mine on a west-coast micro instance (I live in Hawaii, east coast was laggy) and it's 2.5c an hour. That works out to 60c a day, which is $18 a month. The east cost is 2c an hour, which is 48c a day. 14.40 per month.
It's pretty good. You get 1-2 ECUs depending on load (1 ECU is worth a 1.7-2ghz Intel Xeon from 2007) and 613mbs of Ram. I can't wait till the 1st of November, then the Micro instance will be free to use for new users. :]
So far, WorldEdit is the only thing that lags the server. And fire. I had 7 players on and it was running fine.
If you're spinning up micro instances I recommend mounting another ebs volume and creating some swap space. You don't want a kernel panic happening due to running out memory. a 1gb ebs volume costs like 50 cents per month if you're using it as swap. You can create and mount an ebs volume using the AWS management console on their website then google for "mount swap linux" to find out how to mount it as swap. If you like you can even add it to the fstab so it mounts on boot.
I've been using amazon AWS for about 2 years now and I've found the new micro instances have about the same CPU capability of the small instances. It's just difficult working with that tiny amount of ram. EBS instances are real nice however, I wish we had those long ago :biggrin.gif:.
I tried Linode out but I found their system a little unprofessional compared to amazon and I prefer paying by the hour rather than paying by the month. Plus they screw with the images you have available, blocking various commands that I've found handy in the past (like updatedb). People tested it to run faster for the price but there's more to value than just price and speed for some.
Thank you so much for this guide! It really helped me.
I realize this post is old, but this is still helpful, and I have a question for anyone that would like to answer it:
Now running a Minecraft server of upwards 20 people or so, I am finding that lag is becoming rather apparent. Would upgrading the type of instance help, or what can I do to proactively combat lag issues?
Can you extend the tutorial to include setting up hey0's mod?
I don't have any of the command line knowledge required.
The method I assume I should use is zipping my server files, uploading them to a public dropbox folder, downloading them onto the server and then unzipping them.
So I just set myself up with EC2. I made a mini instance, and it's humming along nicely for one player. However, when I get 3 players concurrently it starts to really hang.
top
Indicates that I am maxing my cpu, though only using 52.4% memory.
Everything is vanilla, I'm launching minecraft with the following command:
screen -S smp java -Xmx512M -Xms512M - jar minecraft_server.jar nogui
Is this the best performance I'm likely to see out of this? Has anyone else run a minecraft server on a micro instance successfully? Is there a way to temporary upgrade the server's resources when demand is higher?
I tried with EC2 and also had massive lag with just two people. Unlike you, my process was at 100% the entire time. I eventually gave up on it and moved to a real VPS.
As far as I can tell running a Minecraft Server on an EC2 Micro is not viable, or at least volitile. I tried with a friend for a while and we figured it was a problem with his NIC (previously noted in the forums). I also guessed that the poor I/O characteristics of the Micro coupled with the heavy reads of thousands of small files was less than optimal.
We did not do much until 1.3, and I wanted to revisit it because of the new save format. Still having some issues I continued to tweak and even set up a ramdrive to take care of any I/O issues. I figured "Hey, if its an I/O problem this should be awesome!". Max I need to be able to host 3 to 5 players, so I was not too worried about having enough ram to allocate for the server.
After still having a problem I ran into some interesting things:
There are more examples, but essentially the server appears to run fine until you touch the CPU just a bit too much or often, and top shows 90%st + and java lists at 99% cpu etc. During this time you really can't do anything / break blocks etc. Given a short period of time, it goes back to 0.0%st and you can play again. Once I noticed that the issue was CPU related, at that point any time I noticed a disturbance in the game I could look over and verify that was the issue with top.
I noticed this happening when chunks were being generated (especially obvious on a new map) and when day was transitioning to night. I also noted it happening at random, when I could not really connect it to a specific event. Unfortunately I think it happens just frequently enough to make it a frustrating experience to attempt to play.
Does anybody know if 3-4 people could play on a server using the Amazon free tier service? or would it go over the alloted bandwidth, causing it to charge me?
** These free tiers do not expire after 12 months and are available to both existing and new AWS customers indefinitely.
As far as I can tell running a Minecraft Server on an EC2 Micro is not viable, or at least volitile. I tried with a friend for a while and we figured it was a problem with his NIC (previously noted in the forums). I also guessed that the poor I/O characteristics of the Micro coupled with the heavy reads of thousands of small files was less than optimal.
We did not do much until 1.3, and I wanted to revisit it because of the new save format. Still having some issues I continued to tweak and even set up a ramdrive to take care of any I/O issues. I figured "Hey, if its an I/O problem this should be awesome!". Max I need to be able to host 3 to 5 players, so I was not too worried about having enough ram to allocate for the server.
After still having a problem I ran into some interesting things:
There are more examples, but essentially the server appears to run fine until you touch the CPU just a bit too much or often, and top shows 90%st + and java lists at 99% cpu etc. During this time you really can't do anything / break blocks etc. Given a short period of time, it goes back to 0.0%st and you can play again. Once I noticed that the issue was CPU related, at that point any time I noticed a disturbance in the game I could look over and verify that was the issue with top.
I noticed this happening when chunks were being generated (especially obvious on a new map) and when day was transitioning to night. I also noted it happening at random, when I could not really connect it to a specific event. Unfortunately I think it happens just frequently enough to make it a frustrating experience to attempt to play.
Hey have you figured out anything?
I'm also experiencing the same thing... I can't relate it to anything I do meaning it seems it happens at random. Even when I'm just a single player on the server.
It's frustrating enough so that me and 2 friends figure its not worth it to try playing on it.
Are you playing on a vanilla server?
Thanks for the interesting links though... Have you tried any CPU limiting on your own side? Is that even possible/feasible?
I FOUND A SOLUTION! (FOR THE MICRO INSTANCE USERS)
(assuming you chose the cheaper linux instance, which you SHOULD)
If you want to run a small MC server on a EC2 MICRO instance, you are going to have to limit the cpu usage of the java process. Install cpulimit (google is your friend). It is a very simple utility that allows you to limit a processes CPU usage by PERCENTAGE.
Example: "sudo ./cpulimit -e java -l 25 -v -z"
This runs the command as root (which is supposedly better?)
Looks for the java process (there is an option for PID if you need it)
-l 25 means limit to 25%
-v is verbose so you can see it in action
-z is "lazy" meaning it quits when the process closes
What this does is essentially make you the cpu throttler instead of horrible amazon. If you allow MC to run free, it spikes up for a short bit and amazon throttles it back, you hit 99% usage for up to 30s or a minute even, clients get dropped, server freezes, its bad.
WITH cpulimit in place, the server occasionally has a small bit of lag. Small meaning lasts about 5-10 seconds at WORST, and does not cause disconnects. It is now playable, feasible, reasonable, usable, manageable, and no longer frustrating! Best of all, its insanely CHEAP. (even more so if you're a first time user)
I run several mods, with biome + craftbukkit. I was playing with 3 people on the server at once.
Hope this helps someone... If it does, please reply with your results and/or questions.
(Keep in mind, its probably best to run your MC server and the cpulimit utility in screens. I assume if you have this problem and you've gotten to this point, you know what a screen is.)
It can definitely handle 2 people. Easily.
Three people... it seems to depend on who joined. I've had some very good sessions with three people on the server.
Yet just recently, three people started to choke the little micro server.
I was setting the cpulimit between 30-50%. Seems that's around the point where the amazon throttle kicks in.
Anyways, might still be too early to tell. But I can pretty much guarantee it works with 2 people.
I've just found that putting the server's .jar file directly into /dev/shm and running it from there results in a very significant increase in performance on my micro instance. It makes sense given how slow ebs stores for micro instances are.
I didn't need to use cpulimit, but then I was only testing it with myself logged in. Even then I was only seeing about 2% cpu usage. Does the server load go up more than you'd expect with more users? If you do want to make sure you get consistent performance, then cpulimit would make sure that server performance degrades predictably with more users.
I should point out that if you're doing this, then you need to make your own arrangements for backing up your world files etc. Especially in my case, as I'm running a spot request instance. (I only pay $6 a month on average, but my server is sometimes shutdown when prices go over US$0.01 / hr, and restarted when they come back down).
Hi there,
I have been trying desperately to get the MAKE command to work. I'm on an EC2 micro server, and experiencing the same cpu-throttling lag spikes mentioned above. I cannot install cpulimit of the life of me, because I can't get make to work on the source. I have installed all the gcc files, using "sudo yum install gcc*", as well as "sudo yum groupinstall "development libraries""
I'm getting nothing. Argh! Anyone have any tips on how to get MAKE on an EC2 micro server?
Or an alternative way of getting CPU limit?
Thanks for all the fascinating and useful responses!
An update. I did the sysbench testing (which takes some setting up with make and libtoolize) on my Micro instance and sure enough, the CPU capacity is great for short bursts (generating >1000 primes in 2 seconds) before getting absolutely throttled into the ground.
I upgraded to Small and retested. Now the CPU is stable at 400 primes every 2 seconds, no throttling.
My revised setup:
- running Small
- 1GB heap
- If like me you run this server 24/7, you are *much better off* using the 'Reserved instances' option. I bought my Small instance for 3 years, which costs me $350 (less than $10 per month!).
Warning: I am typing this with the mindset that you've seen a linux box before, and as such, one can navigate thru a text based terminal. If you can't, go slower and learn. Google is your friend. I look stuff up all the time..
First of all, I wanted to play with the EC2 Instance that was provided by AWS. Not any of the other flavors one could obtain if you had to pay.
Thus, I have a small t1.micro instance running AMI: amzn-ami-2011.02.1.x86_64-ebs (ami-8e1fece7)
As you may know those instances are semi Fedora flavored, at least as far as I can tell.
So you will be using YUM if you want to do any kind of non-manual package upgrades.
You will have to sudo yum for anything to stick.
I would recommend that you "sudo yum groupinstall development-tools" (this gets you gcc, make and all the build tools)
Then a "sudo yum update" once or twice followed by a "sudo yum install screen"
If your interested, there is also a yum grouplist that will show all available groups name.
(Getting Web Services to run was pretty easy doing this)
After hit the return key you will get a list like the following:
Administration Tools
Compatibility Arch Support
Editors
Development Tools
GNOME Desktop Environment
GNOME Software Development
Games and Entertainment
Graphical Internet
Graphics
Mail Server
…..
You should see them in two categories. “Installed” and “Available”. Hopefully, one knows what that means.
For your information the partition you get to play with is 8GB.
so, I've also went ahead and provisioned an additional 1GB EBS volume, attached it to the instance as /dev/sdb1
and added it to the system as a swap partition. (This may cost me a dollar or two extra a month, so long as the swap doesn't go and thrash all over the place.. (Read: memory leak) If you do this, use one of the free alarms and set a alert for excessive IO access.
The hardest part was getting the additional volume attached to the instance. It helped to have the instance in a stopped state, and looking paying attention to the EBS volume section of the control panel didn't hurt either. Once I had the volume attached, I booted the instance, and did a old fashioned "'Add swap after install' dance"
mkswap /dev/sdb1
swapon /dev/sdb1
sudo nano /etc/fstab #(opens a text editor, paste the next line on the top, Save with Crtl-X )
/dev/sdb1 none swap sw 0 0
cpulimit must see the pid to attach.. So, run screen, then mine craft, then switch to a new window and run cpulimit
When you are done playing, detach from screen, (Ctrl-A d) to leave every thing running.
I'm still playing around with the instance. It might be good for recursion testing of a new build, or perhaps a 5 man server tops, but AWS's CPU throttle will bring the server to it's knees. Until I had installed cpulimit, it preformed worse than a P4 800mhz w/ 360M memory I had lying around that I threw Dammn Small Linux on..
Hope this helps a little. perhaps we can find a way around that cursed throttle.
Rollback Post to RevisionRollBack
It's worse than you think,
They are out to get you... sssssssssssssssss
I'm running mine on a west-coast micro instance (I live in Hawaii, east coast was laggy) and it's 2.5c an hour. That works out to 60c a day, which is $18 a month. The east cost is 2c an hour, which is 48c a day. 14.40 per month.
It's pretty good. You get 1-2 ECUs depending on load (1 ECU is worth a 1.7-2ghz Intel Xeon from 2007) and 613mbs of Ram. I can't wait till the 1st of November, then the Micro instance will be free to use for new users. :]
So far, WorldEdit is the only thing that lags the server. And fire. I had 7 players on and it was running fine.
To all who wonder how to use screen to create 'background' processes and to be able to control the console of the server AND have another window open for linux commands, I used these guides:
http://www.rackaid.com/resources/linux- ... nd-how-to/
http://www.linux.com/archive/feed/56443
Thanks again a1r!
I've been using amazon AWS for about 2 years now and I've found the new micro instances have about the same CPU capability of the small instances. It's just difficult working with that tiny amount of ram. EBS instances are real nice however, I wish we had those long ago :biggrin.gif:.
I tried Linode out but I found their system a little unprofessional compared to amazon and I prefer paying by the hour rather than paying by the month. Plus they screw with the images you have available, blocking various commands that I've found handy in the past (like updatedb). People tested it to run faster for the price but there's more to value than just price and speed for some.
I realize this post is old, but this is still helpful, and I have a question for anyone that would like to answer it:
Now running a Minecraft server of upwards 20 people or so, I am finding that lag is becoming rather apparent. Would upgrading the type of instance help, or what can I do to proactively combat lag issues?
Thanks again!
So, shall you seek the Echoes? Click here and see if you have what it takes, or if you are even interested.
"Belief is the death of intelligence." -Robert Anton Wilson
I don't have any of the command line knowledge required.
The method I assume I should use is zipping my server files, uploading them to a public dropbox folder, downloading them onto the server and then unzipping them.
How does one do that?
EDIT:
wget and then unzip. Easy enough.
EDIT2:
Check out this post for sftp into EC2 using Filezilla.
Indicates that I am maxing my cpu, though only using 52.4% memory.
Everything is vanilla, I'm launching minecraft with the following command:
Is this the best performance I'm likely to see out of this? Has anyone else run a minecraft server on a micro instance successfully? Is there a way to temporary upgrade the server's resources when demand is higher?
Everytime I attempt, I either have a timed out connection or a denied public key.
I'm pulling my hair out.
Please, any suggestions?
Because, I wonder how it handles only one core, when the server itself its spread across multiple....
We did not do much until 1.3, and I wanted to revisit it because of the new save format. Still having some issues I continued to tweak and even set up a ramdrive to take care of any I/O issues. I figured "Hey, if its an I/O problem this should be awesome!". Max I need to be able to host 3 to 5 players, so I was not too worried about having enough ram to allocate for the server.
After still having a problem I ran into some interesting things:
http://gregsramblings.com/2011/02/07/am ... cpu-steal/
http://huanliu.wordpress.com/2010/06/14 ... pute-unit/
There are more examples, but essentially the server appears to run fine until you touch the CPU just a bit too much or often, and top shows 90%st + and java lists at 99% cpu etc. During this time you really can't do anything / break blocks etc. Given a short period of time, it goes back to 0.0%st and you can play again. Once I noticed that the issue was CPU related, at that point any time I noticed a disturbance in the game I could look over and verify that was the issue with top.
I noticed this happening when chunks were being generated (especially obvious on a new map) and when day was transitioning to night. I also noted it happening at random, when I could not really connect it to a specific event. Unfortunately I think it happens just frequently enough to make it a frustrating experience to attempt to play.
does this mean i could use the free tier forever?
Hey have you figured out anything?
I'm also experiencing the same thing... I can't relate it to anything I do meaning it seems it happens at random. Even when I'm just a single player on the server.
It's frustrating enough so that me and 2 friends figure its not worth it to try playing on it.
Are you playing on a vanilla server?
Thanks for the interesting links though... Have you tried any CPU limiting on your own side? Is that even possible/feasible?
Thanks!
I FOUND A SOLUTION! (FOR THE MICRO INSTANCE USERS)
(assuming you chose the cheaper linux instance, which you SHOULD)
If you want to run a small MC server on a EC2 MICRO instance, you are going to have to limit the cpu usage of the java process. Install cpulimit (google is your friend). It is a very simple utility that allows you to limit a processes CPU usage by PERCENTAGE.
http://cpulimit.sourceforge.net/
(I had to install gcc too before "make" worked for cpulimit)
(I also installed svn so I could just easily get it with:
"svn checkout https://cpulimit.svn.sourceforge.net/sv ... imit/trunk cpulimit")
Example: "sudo ./cpulimit -e java -l 25 -v -z"
This runs the command as root (which is supposedly better?)
Looks for the java process (there is an option for PID if you need it)
-l 25 means limit to 25%
-v is verbose so you can see it in action
-z is "lazy" meaning it quits when the process closes
What this does is essentially make you the cpu throttler instead of horrible amazon. If you allow MC to run free, it spikes up for a short bit and amazon throttles it back, you hit 99% usage for up to 30s or a minute even, clients get dropped, server freezes, its bad.
WITH cpulimit in place, the server occasionally has a small bit of lag. Small meaning lasts about 5-10 seconds at WORST, and does not cause disconnects. It is now playable, feasible, reasonable, usable, manageable, and no longer frustrating! Best of all, its insanely CHEAP. (even more so if you're a first time user)
I run several mods, with biome + craftbukkit. I was playing with 3 people on the server at once.
Hope this helps someone... If it does, please reply with your results and/or questions.
(Keep in mind, its probably best to run your MC server and the cpulimit utility in screens. I assume if you have this problem and you've gotten to this point, you know what a screen is.)
It can definitely handle 2 people. Easily.
Three people... it seems to depend on who joined. I've had some very good sessions with three people on the server.
Yet just recently, three people started to choke the little micro server.
I was setting the cpulimit between 30-50%. Seems that's around the point where the amazon throttle kicks in.
Anyways, might still be too early to tell. But I can pretty much guarantee it works with 2 people.
I didn't need to use cpulimit, but then I was only testing it with myself logged in. Even then I was only seeing about 2% cpu usage. Does the server load go up more than you'd expect with more users? If you do want to make sure you get consistent performance, then cpulimit would make sure that server performance degrades predictably with more users.
I should point out that if you're doing this, then you need to make your own arrangements for backing up your world files etc. Especially in my case, as I'm running a spot request instance. (I only pay $6 a month on average, but my server is sometimes shutdown when prices go over US$0.01 / hr, and restarted when they come back down).
I have been trying desperately to get the MAKE command to work. I'm on an EC2 micro server, and experiencing the same cpu-throttling lag spikes mentioned above. I cannot install cpulimit of the life of me, because I can't get make to work on the source. I have installed all the gcc files, using "sudo yum install gcc*", as well as "sudo yum groupinstall "development libraries""
I'm getting nothing. Argh! Anyone have any tips on how to get MAKE on an EC2 micro server?
Or an alternative way of getting CPU limit?
thank you!
An update. I did the sysbench testing (which takes some setting up with make and libtoolize) on my Micro instance and sure enough, the CPU capacity is great for short bursts (generating >1000 primes in 2 seconds) before getting absolutely throttled into the ground.
I upgraded to Small and retested. Now the CPU is stable at 400 primes every 2 seconds, no throttling.
My revised setup:
- running Small
- 1GB heap
- If like me you run this server 24/7, you are *much better off* using the 'Reserved instances' option. I bought my Small instance for 3 years, which costs me $350 (less than $10 per month!).
Warning: I am typing this with the mindset that you've seen a linux box before, and as such, one can navigate thru a text based terminal. If you can't, go slower and learn. Google is your friend. I look stuff up all the time..
First of all, I wanted to play with the EC2 Instance that was provided by AWS. Not any of the other flavors one could obtain if you had to pay.
Thus, I have a small t1.micro instance running AMI: amzn-ami-2011.02.1.x86_64-ebs (ami-8e1fece7)
As you may know those instances are semi Fedora flavored, at least as far as I can tell.
So you will be using YUM if you want to do any kind of non-manual package upgrades.
You will have to sudo yum for anything to stick.
I would recommend that you "sudo yum groupinstall development-tools" (this gets you gcc, make and all the build tools)
Then a "sudo yum update" once or twice followed by a "sudo yum install screen"
If your interested, there is also a yum grouplist that will show all available groups name.
(Getting Web Services to run was pretty easy doing this)
After hit the return key you will get a list like the following:
Administration Tools
Compatibility Arch Support
Editors
Development Tools
GNOME Desktop Environment
GNOME Software Development
Games and Entertainment
Graphical Internet
Graphics
Mail Server
…..
You should see them in two categories. “Installed” and “Available”. Hopefully, one knows what that means.
For your information the partition you get to play with is 8GB.
so, I've also went ahead and provisioned an additional 1GB EBS volume, attached it to the instance as /dev/sdb1
and added it to the system as a swap partition. (This may cost me a dollar or two extra a month, so long as the swap doesn't go and thrash all over the place.. (Read: memory leak) If you do this, use one of the free alarms and set a alert for excessive IO access.
The hardest part was getting the additional volume attached to the instance. It helped to have the instance in a stopped state, and looking paying attention to the EBS volume section of the control panel didn't hurt either. Once I had the volume attached, I booted the instance, and did a old fashioned "'Add swap after install' dance"
mkswap /dev/sdb1
swapon /dev/sdb1
sudo nano /etc/fstab #(opens a text editor, paste the next line on the top, Save with Crtl-X )
/dev/sdb1 none swap sw 0 0
For extra credit:
swapon -a
swapon -s
To obtain and build cpulimit I went to my /home/ec2-user directory
wget http://downloads.sourceforge.net/cpulimit/cpulimit-1.1.tar.gz
tar zxf cpulimit-1.1.tar.gz
cd cpulimit-1.1
make
cp cpulimit /usr/bin
cpulimit must see the pid to attach.. So, run screen, then mine craft, then switch to a new window and run cpulimit
When you are done playing, detach from screen, (Ctrl-A d) to leave every thing running.
I'm still playing around with the instance. It might be good for recursion testing of a new build, or perhaps a 5 man server tops, but AWS's CPU throttle will bring the server to it's knees. Until I had installed cpulimit, it preformed worse than a P4 800mhz w/ 360M memory I had lying around that I threw Dammn Small Linux on..
Hope this helps a little. perhaps we can find a way around that cursed throttle.
They are out to get you... sssssssssssssssss