Librenix
Headlines | Linux | Apps | Coding | BSD | Admin | News
Information for Linux System Administration 

Testing the Digital Ocean $5 Cloud Servers with an MMORPG

Up
vote
Down

I've been working on an space-based MMORPG for a while now and I finally reached a point where the server was largely complete and ready for some load testing. I had done quite a bit of testing on my quad-core Xeon development system with great results. Renting a dedicated box like that one, and with a decent Internet connection would not be cheap, however.

I was curious about Digital Ocean's offerings so I decided to take a couple of their smallest virtual machines for a test run. These 5 dollar/month cloud servers have 512MB of memory, a single virtual CPU, and 20 gigabytes of SSD disk storage. I created the first one, Maelstrom, in one of their New York data centers and the second one, Paradise, in their San Fransico facility. As claimed, each server took just under 60 seconds to deploy.

I made a few customizations to the bare-bones CentOS 6.5 64-bit image that I had selected for both machines. I then ran my personal benchmark package on both. On my 256 megabyte benchmark that emulates a relational database instance, I got about 25% of the performance of one of my Ivy Bridge Xeon cores. This benchmark stresses memory bandwidth, takes advantage of the full range of caches, as well as loading the CPU with integer-only operations.

I consider a fourth of an Ivy Bridge core an excellent result for a $5(US) server! I repeated the tests over the following days and got consistent results varying within a 10 percent range. One thing of note; the SF server consistently performed about 10% faster than the NY server.

Next, I loaded up a million-sector instance of my MMORPG server engine on the NY server and a bundle of testing scripts on the SF machine. The test suite, which emulates 712 concurrent players requires 1424 processes to do that. In retrospect, it wasn't too surprising that I crashed the SF machine as the testing scripts created an urgent demand for far more than 512 MB of memory! My mistake. I suspected that I wasn't going to be able to fully stress the game engine with far fewer emulated players.

But, always the optimist, I set up a gigabyte of swap space on Paradise and tried again. This time the tests ran just fine -- and the SSD-based swap space performed beautifully.

I got an average of 2500 game transactions per second over the duration of the test -- which should be more than enough for my target of 1000 concurrent players per realm. The SF machine used one half of the GB(!) of swap space while running the test scripts and hummed along happily at about 75% busy.

The NY server was fully stressed at about 98% CPU utilization and remained very responsive for the duration of the test.

I'm still running both systems three weeks later and have experienced no reboots or outages so far.

The New York server continues to run my text-based space MMORPG server back-end for game-play testing as the graphical front-end client is developed.
mail this link | permapage | score:9979 | -Ray, May 13, 2014

Nuvola Player: Enjoy all your Cloud music services from one interface

Up
vote
Down

And with tight integration with the Linux desktop (multimedia keys, system tray, media player applets, dock menu, notifications and more), it provides a better user experience when compared to using the same Cloud music services from a Web browser. read more...
permapage | score:9693 | -finid, August 21, 2013

Currency Traders Telnet Game

Up
vote
Down

A new, large Currency Traders game is up. To connect enter the following command from an xterm, konsole, or other terminal/command line window:

[link removed]

It runs on port 23, just like traditional telnet. It's free to play and no software is required to play. All you need is an internet connection.

This is an old-school, no-graphics strategy game. All you need is a telnet client to play -- and every modern operating system comes with one. It's free and you can play anonymously. Just choose a name and a password and log in. If you don't know what to do, just press your H key for a Hint and a context-sensitive Tip.

This game is played in a persistent world where whatever you build, buy, or otherwise 'acquire' in the game will still be there tomorrow. Unless you make an enemy of another player, that is. PVP (player-versus-player) is always enabled here so other players can attack your deployed fortifications -- or even, heaven forbid, you.

This is a turn-based game that can be played any time of the day, night, or week. Each player is issued a certain amount of energy (turns) per day that is used to travel, trade, or play at the arcade in the several Malls. If you don't use your turns, they accumulate for as much as several months -- so there's no disadvantage to skipping a day or even a few weeks.


(Try the [read more] link if you want to see something similar, a text-based mmorpg)
read more...
mail this link | permapage | score:9600 | -Ray, January 23, 2013 (Updated: May 13, 2014)

VPS: Xen vs. OpenVZ

Up
vote
Down

This is a short overview of the key differences between OpenVZ and Xen that you might consider when choosing a VPS. Note that this article is based on my opinions and that you must do your own research to determine which, if either, technology is best for you and your application.

First, some terminology. OpenVZ isn't fully virtualized and could be more properly referred to as a 'container', not a VPS. That shouldn't affect your choice. It's the technical differences that matter.

Cheap VPS offers are everywhere lately, it seems. However, upon closer inspection I saw that almost all of the low-priced offers were for OpenVZ. While both Xen and OpenVZ offer their advantages, I chose Xen. So, there's my first bias, right up front. :)

OpenVZ advantages:

  • Efficient (fast)
OpenVZ disadvantages:
  • Shared kernel (no custom kernel)
  • Shared memory with other users
  • Vendor can easily oversell, killing performance
Xen advantages:
  • Dedicated memory
  • fully virtualized (can run other kernels or even OS's)
  • vendor more limited in overselling
Xen disadvantages
  • Less efficient (more overhead due to a kernel-per-VPS)

You'll notice I left price out of the above comparison. In theory, there should be a small price advantage for OpenVZ. I don't know how big it should be but it pertains to two things: 1) Xen uses more memory due to each VPS having its own kernel, and 2) Xen uses more CPU, also due to the additional software layer required to virtualize the kernel.

In practice, however, the price gap appears larger than the above technical differences suggest it should be. I think the remainder of OpenVZ's price advantage is based on 1) the ability for a vendor to easily oversell OpenVZ, and 2) The price competition that results from some vendors overselling OpenVZ.

OpenVZ doesn't encapsulate its containers into a fixed amount of memory, so it runs processes in the host environment to monitor memory usage and kill processes as a container allocates more than its assigned amount.

As a result of this difference, loading down an OpenVZ container is problematic. To partially offset this disadvantage, most OpenVZ vendors offer 'burst' memory in addition to 'dedicated' memory. That is, the monitor process is set to allow the container to use more than its allocated memory -- for a short period of time. This messy situation results in a potentially unreliable environment as some of your processes may be arbitrarily killed -- at the busiest times.

Xen, on the other hand, allows the use of a swap space and excess memory allocation results in (hopefully) idle segments being rolled out to the swap area. While this is good for the memory-hungry VPS user, it can consume significant I/O capacity when memory is overallocated to the point of busy segments getting swapped out. This is bad for everyone sharing the underlying hardware.

I see Xen as clearly the superior technology. A Xen VPS feels and behaves more like a dedicated server. However, I still would have purchased OpenVZ at some price difference. After a bit of research, however, I located Xen VPS's at practically the same price as the cheapest OpenVZ containers. That made my decision easy.

With that said, keep in mind that a bad hosting vendor can ruin either technology through various means. Both technologies share the disk drives and I/O paths as well as the processor cores. Hardware can be poorly configured and managed in any case. A reputable vendor is probably the single most important consideration in choosing a virtual server.

Lastly, carefully check the 'allowed use' policy. Make sure your application is allowed on the server you intend to purchase. Note that due to their different characteristics, the allowed use policy may differ between OpenVZ and Xen for the same host. Also, it's good to understand the memory usage characteristics of your applications. If you know how much memory/swap they require on a physical system, it'll probably work with that same amount of memory/swap on Xen.

[I'll post a review shortly of my current VPS vendor and I will then add a link to that article here.]

mail this link | permapage | score:9564 | -Ray, June 13, 2011

FreeBSD 8.0: First Look

Up
vote
Down

A look at the newest FreeBSD distribution...
The ZFS file system is included in FreeBSD 8.0 and from previous experience I've found it to work very well. However, my little server didn't really have the resources to properly experiment with it. For systems with enough RAM and disk to justify its use, I highly recommend taking a look at FreeBSD's ZFS implementation - for the snapshots feature, if nothing else. Being able to restore files without reaching for separate backup media can be a wonderful time saver.
read more...
mail this link | permapage | score:9564 | -Ray, December 8, 2009

Apple DIY Repair

Up
vote
Down

I won't be buying any more Apple products. Here's why:

I'm generally capable of repairing my own equipment and can recognize when self-repair has been deliberately undermined. I recently had to replace a hard drive in an early generation white Intel iMac. Innocently, I believed the interior was accessible and serviceable in the manner of the externally identical white PowerPC iMacs.

No such luck. Not only do you have to remove the LCD to get to the hard drive, but you must also remove shielding around the LCD -- mostly by tearing it to bits. No doubt it is attached this way so that an authorized Apple technician will be able to confidently void your warranty if you've ever worked on the system yourself.

You'll also need a #10 torx magnetic screwdriver. And, no, #10 torx bits just won't do due to the narrow and deeply recessed screw holes. Also, since most torx screwdrivers aren't magnetic, you'll probably need to tape the screws to the screwdriver to reattach the LCD. Good thing there's a hardware store near you.

Oh, and don't forget to pick up some rubber cement to 'properly' reattach the hard drive temperature sensor while you're out looking for magnetic torx screwdrivers.

Considering the logical design of its predecessor and the tamper-evident shielding, I'm certain that this machine has been deliberately designed to prevent the owner from performing DIY upgrades and repairs.

While that is all quite annoying, at least working on the system is possible for someone with experience and determination.

Now, Apple has improved their anti-customer techniques with the 'Pentalobe' screw. It doesn't solve any problem but one: it'll keep customers from even being able to open the case.

If you're curious about Apple's evil new invention, you can read its rap sheet and view its mug shot here.
mail this link | permapage | score:9557 | -Ray, January 25, 2011

Python Client/Server Tutorial

Up
vote
Down

A tiny Python tutorial...
This application can easily be coded in Python with performance levels of thousands of transactions per second on a desktop PC. Simple sample programs for the server and client sides are listed below, with discussions following
read more...
permapage | score:9537 | -Ray, June 22, 2009

Expect Script Examples

Up
vote
Down

Expressions, if statements, for loops, and while loops examples are covered in this mini-tutorial:
This article explains the following in the expect scripting language.
  • Expressions – arithmetic operation
  • if construct in expect
  • looping constructs
read more...
permapage | score:9532 | -Ray, January 21, 2011

Linux network tools: iptstate and pkstat

Up
vote
Down

Two small Linux tools for network stats...
iptstate displays information held in the IP Tables state table in real-time in a top-like format. Output can be sorted by any field, or any field reversed. Users can choose to have the output only print once and exit, rather than the top-like system.

Refresh rate is configurable, IPs can be resolved to names, output can be formatted, the display can be filtered, and color coding are among some of the many features.
(here are some red prints) read more...
mail this link | permapage | score:9497 | -Ray, March 4, 2011 (Updated: April 24, 2012)

Linux dominates Windows

Up
vote
Down

Linux dominates Windows -- and everything else -- on supercomputers in 2010. Microsoft's renowned engineering quality and down-to-earth pricing shows brilliantly in its capturing 1% of the top 500 supercomputer projects. Perhaps next year, utilizing all the organizational pressure they can bring to bear, they can retain 0.8%.

Formal Unix, now long dead*, controls 4.4%. Meanwhile, Linux is now installed on 91% of the remaining 95% of top systems. Add in the single BSD system and you have Unix-like systems (Unix+Linux+BSD) accounting for 95.6% of the top supercomputer projects. The remaining 3.4% of are 'mixed' systems and may also contain significant percentages of Unix and Linux.

There are many reasons for Linux' success. Among the top factors are surely these four, in no particular order:
  • Price (starting at free)
  • Quality (excellent code, Unix-based design)
  • Hardware Support (most all modern quality gear is supported)
  • Open Source (open to tinkering -- and redistributable)
Check my math on the top 500 systems here.

*Of course, counting functional Unix systems while ignoring the trademarked term, Unix is clearly not dead since Linux is one of the truest of the true Unix work-alike systems. Linux is, of course, the reason formal Unix has suffered such a precipitous decline. Many Unix users just switched flavors -- and Linux was a most appealing flavor.
mail this link | permapage | score:9424 | -Ray, June 2, 2010

System monitoring: Icinga, Nagios, and Opsview

Up
vote
Down

Three open-source system monitoring software packages, two of which are derived from Nagios...
If in your work you are responsible for just one server, you will surely wonder: What is the best way to get the situation under control?

In the world there are good open source software that allow you to monitor the status of servers, services and programs.

In this article we’ll see an overview some of the softwares in this category, and in particular some related to Nagios...
read more...
mail this link | permapage | score:9421 | -Ray, March 24, 2011

Tutorial: Linux game programming with Ogre 3D

Up
vote
Down

This tutorial starts at the beginning with opening a window...
This tutorial series steps you through the process of creating a 3D shoot'em'up game using the popular and powerful Ogre 3D engine. The tutorials compile on both Windows and Linux.
read more...
permapage | score:9414 | -Ray, January 1, 2010

Linux file manager comparison review

Up
vote
Down

Reviewing and rating six of the best Linux file managers...
The litmus test for any file manager, then, is its ability to manage large numbers of files efficiently, and this is one of the two main criteria for the applications in this roundup. Our other primary concern is advocacy. Could each file manager here help convince inexperienced Linux users that the OS can be either familiar and easy to use, or different in that it's much more flexible than what they've previously experienced?
read more...
mail this link | permapage | score:9403 | -Ray, April 20, 2011

Librenix T-Shirts and Coffee Mugs!

Up
vote
Down

For today's example of my (semi)elite C programming skilz, I submit for your inspection the Librenix T-Shirts! Yes, I created the images on these shirts and coffee mugs entirely with C code. While the code isn't up to the standards *cough* of my open source Space Tyrant project, at least the output is colorful and not entirely textual!


click either image to see the T-Shirts, Coffee Mugs, etc.

(If you like the images but don't care for 'librenix' on your shirt, these same styles are available for all 50 US state names as well as with the signs of the zodiac here)

(and here are some modern prints)
mail this link | permapage | score:9383 | -Ray, June 6, 2010 (Updated: May 13, 2014)

Ubuntu Linux vs. PC-BSD

Up
vote
Down

A comparison between Ubuntu 7.04 Linux (Fiesty Fawn) and the upcoming release of PC-BSD 1.4.
PC-BSD, on the other hand, "has been designed with the casual computer user in mind. Installing the system is simply a matter of a few clicks and a few minutes for the installation process to finish. Hardware such as video, sound, network, and other devices will be auto-detected and available at the first system startup. Home users will immediately feel comfortable with PC-BSD's desktop interface, with KDE 3.5 running under the hood.
read more...
mail this link | permapage | score:9382 | -Ray, August 24, 2007

Alternative operating systems

Up
vote
Down

The ten best alternative OSes, none of which are from Microsof or Apple, nor are any based on Linux. Operating systems covered are:
  • GNU/HURD (RMS' never-quite-done free OS, predates Linux(!))
  • JNode (written in Java)
  • FreeVMS (DEC's famous VMS)
  • DexOS (tiny, console-like GUI)
  • Inferno (distributed, device-sharing)
  • KolibriOS (MenuetOS fork, tiny, written in Assembly)
  • OpenBSD (a BSD variant specializing in security, correctness)
  • AROS (Amiga Research Operating System )
  • ReactOS (Windows clone)
  • Haiku (BeOS clone)
From the article:
Big companies can grow reticent to change, slow to move and adopt new technologies. Features must be escalated through approval bodies, management and bean-counters. Hobbyist projects don't have those commercial pressures and can experiment freely.

It might seem audacious to claim that the next Windows is cooking in some part-time coder's house, but it's nothing new. Microsoft's OS empire started with the purchase of QDOS, which stood for 'Quick and Dirty Operating System'. Apple didn't create Mac OS X out of thin air, but took an open source kernel and some BSD code (grounded in academia) to get the foundations of its operating system working.
read more...
mail this link | permapage | score:9368 | -Ray, March 16, 2011

Scripting: A parallel Linux backup script

Up
vote
Down

This example bash shell script demonstrates a simple method of creating backups of multiple filesystems to multiple tape devices simultaneously. While the script presented writes to four tape drives in parallel, it can easily be modified to write to other device types and to create a different number of backup streams. The script is set up for the bash shell under Linux, but modifying it for another variety of Unix should simply be a matter of changing the locations of utility files such as tar, echo, cp, and sleep.

The script can be downloaded from http://librenix.com/scripts/par.tar.sh. Download the file now and load it into an editor as this article will refer to it frequently. Also, you may want to modify bits of it to match your filesystem names and your devices.

The first line of the script looks like this:
 #!/bin/bash
If the bash shell isn’t in the /bin directory on your system, you’ll need to modify this line. Enter the command which bash now to verify the location of bash. My Fedora Linux system and my Mac OS X system both have bash in /bin, but my FreeBSD system does not. If you have a non-Linux flavor of Unix, you’ll probably need to use the ‘which’ command to verify the locations of each command used in the script. The commands used are:
 bash
cd
sleep
echo
date
tar
wait
ls
wc
Note that ‘wait’ and ‘cd’ are usually implemented as internal shell commands and may not have external commands associated with them. If that is true for your system, leave ‘cd’ and ‘wait’ with no directory prefix just as they are in the original script.

Now, the first command in the script resets the current working directory to ‘/’:
 cd /
Since the script precedes each directory to be backed up with a ‘.’ to represent the current working directory, starting out at ‘/’ is necessary. The reason for this precaution is that some implementations of the tar command will only load files from a tar archive into the exact directory that was specified when the file was backed up. By prefixing the names with a ‘.’ we preserve the ability to recover the files into any subdirectory we want, without overwriting the original files.

Immediately after the ‘cd /’ command is where you would put any commands to shut down all services that must be quieted prior to a backup. The example script has a (commented out) command to initiate an Oracle database shutdown followed by a ‘sleep’ command to allow time for the shutdown to complete. The example database shutdown and the following delay probably don’t apply to your system. Obviously, you’ll have to add commands yourself to stop any applications that might interfere with the backup.

Next, we use the ‘date’ command to create two sets of four tiny files to stick at the start and end of each tape. Note that the presence of a ‘date.#’ file at the beginning of each tape lets you quickly find out when a tape was created and on which drive. The ‘zzzz.#’ files, appended to the end of each tape, only serve to let you easily verify that a backup completed without overrunning the end of the tape.

Next, we start the four actual ‘tar’ backup commands, each with sample directories named ‘./dir1’, ‘./dir2’, etc. Of course, you’ll need to modify the list of directories to match the actual directories you wish to back up. Note that you’ll probably want to balance the directory sizes so that all of the largest directores aren’t on the same tape. Also, note that each ‘tar’ command is run in the background and logs to a tar.#.log file in the /tmp directory. Obviously, you might want to put the logfiles somewhere else.

After each ‘tar’ command there is an entry like this: ‘TASK=$0’, or ‘TASK=$1’. These arbitrarily-named ‘TASK’ variables are used to store the process ID of each ‘tar’ command so that the script can wait for them with the four ‘wait’ commands that follow in the next block of code. There, we have the four ‘wait’ commands waiting on the $TASK0, etc, variables. (The addition of the ‘$’ to each TASK# shell variable is not a typo -- it’s necessary to read back the contents of the variable.)

Next, after the script has waited for the completion of each of the four ‘tar’ commands, it appends some information to a history file for later reference. It stores the date of the backup, the filesize of the logfile, and the number of files backed up on each tape to each of four history files. While the script will overwrite the logfiles (tar.#.log) each time it is run, it will append these three lines to each of the four history files (tar.#.history).

The final steps in the script are commented out. Those are the commands necessary to restart any applications that were brought down for the backup. Again, in the example we assume an Oracle database needs to be restarted. You’ll need to add the commands necessary to start any applications that were stopped at the beginning of the script.
mail this link | permapage | score:9353 | -Ray, April 10, 2005

Linux vs Mac OS X

Up
vote
Down

Five ways Linux beats Mac OS X...
First is the question of permissions: Linux users are not automatically given administrator privileges on their computers, meaning that viruses and malware don't automatically have access to everything in the proverbial "castle." So, when a computer is compromised, the most the malware can typically do is trash the user's local files and programs.

With Apple, on the other hand--as with Windows--social engineering is painfully easy. Just convince the user to click on something, and away you go, with the castle keys in hand.
read more...
mail this link | permapage | score:9350 | -Ray, October 4, 2010

Beginner Ubuntu Tips

Up
vote
Down

Twenty-five tips for Ubuntu beginners...
Adding another source for software is easy; once you've installed addrepo, you can do it in the terminal by typing something along the lines of addrepo deb http://mirror2.ubuntulinux.nl/ lucid-seveas all.

If you find new repositories online, they will usually give you the right details to enter. You could also do it graphically by going to 'System | Administration | Software Sources | Third Party Software | Add'. read more...
permapage | score:9334 | -Ray, November 9, 2010

Linux Top command examples

Up
vote
Down

Fifteen examples of Linux usage of the top command with short explanations...
In this article, let us review 15 examples for Linux top command that will be helpful for both newbies and experts.

1. Show Processes Sorted by any Top Output Column – Press O

By default top command displays the processes in the order of CPU usage. When the top command is running, press M (upper-case) to display processes sorted by memory usage as shown below.
read more...
permapage | score:9320 | -Ray, January 12, 2010
More articles...
Buy Art Online with a Free Return Policy

Selected articles

Why software sucks

The Network Computer: An opportunity for Linux

Scripting: A parallel Linux backup script

Apple DIY Repair

The life cycle of a programmer

The Real Microsoft Monopoly

Librenix T-Shirts and Coffee Mugs!

Apple to Intel move no threat to Linux

The Supreme Court is wrong on Copyright Case

The short life and hard times of a Linux virus

Why Programmers are not Software Engineers

Space Tyrant: A multiplayer network game for Linux

Testing the Digital Ocean $5 Cloud Servers with an MMORPG

VPS: Xen vs. OpenVZ

Space Tyrant: Multithreading lessons learned on SMP hardware

Space Tyrant: A threaded C game project: First Code

Hacker Haiku

Linux vs. Windows: Why Linux will win

Tutorial: Introduction to Linux files

No, RMS, Linux is not GNU/Linux

Linux dominates Windows

Closed Source Linux Distribution Launched

Shadow.sh: A simple directory shadowing script for Linux

Download: Linux 3D Client for Starship Traders

Mono-culture and the .NETwork effect

Programming Language Tradeoffs: 3GL vs 4GL

MiniLesson: An introduction to Linux in ten commands

Beneficial Computer Viruses

How to install Ubuntu Linux on the decTOP SFF computer

Microsoft to push unlicensed users to Linux

Graffiti Server Download Page

Space Tyrant: A threaded game server project in C

Missing the point of the Mac Mini

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

 
Articles are owned by their authors.   © 2000-2012 Ray Yeargin