Using Ruby Fibers for Async I/O: NeverBlock and Revactor
Ruby 1.9's Fibers and non-blocking I/O are getting more attention - we talked to Mohammad A. Ali of the NeverBlock project and Tony Arcieri of the Revactor project.
Tracking change and innovation in the enterprise software development community

Posted by Craig Wickesser on Aug 04, 2008 09:52 AM
The idea of providing IT capabilities as services using the Internet is relatively new and has recently peaked a lot of interest. There have been several articles on Infoq which provided “An Introduction to Virtualization” and security but there hasn’t been a comparison of the different “cloud” providers. This article will cover three “cloud” companies that provide server centered solutions. It will provide an overview of how to get started with each one. Each will also be compared in terms of features, pricing and availability.
Rainmaking - IBM's software virtualization strategy (Jerry Cuomo CTO blog)
Introducing Application Infrastructure Virtualization and WebSphere Virtual Enterprise
Virtualize and Govern Your SOA with WebSphere Virtual Enterprise
WebSphere Virtual Enterprise 3 minute demo
Taming the Application Infrastructure using WebSphere Virtual Enterprise
What is cloud computing
Often times when learning about a new technology it’s easy to jump in feet first without having a basic understanding of the fundamentals, only later finding yourself going back to the basics. To avoid having that happen a simple definition of cloud computing proves useful. Wikipedia defines it as:
“A style of computing where IT-related capabilities are provided “as a service” using Internet technologies to multiple external customers. It allows users to consume services without knowledge of, expertise with, nor control over the technology infrastructure that supports them.Generally this holds true but some providers do provide low-level control while others aim to make it as simple as possible.Resources being accessed are typically owned and operated by a third-party provider on a consolidated basis in datacenter locations. Consumers of cloud computing services purchase computing capacity on-demand and are not generally concerned with the underlying technologies used to achieve the increase in server capability. There are however increasing options for developers that allow for platform services in the cloud where developers do care about the underlying technology.”
Why you'd use it
There may be a vast array of reasons as to why an individual or business might use cloud computing. Some reasons include:
The Amazon website provides the following description to explain its service:
“Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers.Amazon EC2's simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon's proven computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually use. Amazon EC2 provides developers the tools to build failure resilient applications and isolate themselves from common failure scenarios.”
Before getting started with Amazon EC2, Amazon recommends that should be somewhat comfortable in a Linux environment, be somewhat familiar with Web Services, have an SSH client and Java 5 (or newer) installed. Following the instructions outlined below a link will be provided to Amazon’s documentation providing explicit step-by-step instructions.
In order to dig in you must first setup three Amazon accounts. One each at Amazon Web Services (AWS), Amazon Simple Storage Service (Amazon S3) and Amazon EC2. Once you have an AWS account creating the AS3 and AEC2 accounts are just a few clicks away.
Once the accounts are created you need to setup the command line tools. Amazon EC2 provides command line tools as well as an API for managing your cloud. The tools are bundled as a zip (download) which are almost ready to use once extracted, first a few environment variables will need to be configured (EC2_HOME, EC2_PRIVATE_KEY and EC2_CERT).
With the configuration and setup out of the way the next thing to do is launch an Amazon Machine Image (AMI). The command line utilities provide methods for creating your own images as well as listing those made public by Amazon. Once an image is selected you’ll need to generate and SSH keypair which allows you to login to the instance. If you use PuTTY you’ll need to convert the private key to PuTTY’s format, instructions can be found here.
Next you simply use the “ec2-run-instances” command-line tool to start the image selected previously. Momentarily it will be in a “running” state, which can be checked by using the “ec2-describe-instances” command. Before access is available the appropriate ports need to be authorized to be opened. To allow SSH and HTTP you’d use the “ec2-authorize” tool to allow access to port 22 and 80, respectively.
Now to verify things worked properly just access the site URL (given as output when the “ec2-run-instances” command was executed”, something like ec2-67-202-51-223.compute-1.amazonaws.com) using a web browser. With the basic setup and configuration out of the way you can begin deploying content and working with your new cloud.
For detailed instructions the Amazon EC2 Technical Documentation site provides plenty of information. Next we’ll take a look at setting up and configuring GoGrid.
GoGrid
GoGrid touts their service as being the only one which provides true Control in the Cloud TM. They offer a multi-server control panel allowing you to deploy and manage load-balanced cloud servers in minutes. Getting started is a bit simpler and less time consuming than Amazon EC2. Just browse to the GoGrid site and create an account. Within a couple minutes you’ll have a confirmation email and you’re ready to go.
Once you login to your account you’ll be greeted with a simple interface. Clicking the “Add” button provides a few options (shown below):


Once the server is configured it’ll be accessible almost instantly. Opening a browser to the IP address chosen displays a verification message.

Adding load balancers and databases is just as simple as create a web server, just a few clicks and some simple configuration and within a minute it’ll be up and running. Adding additional servers can be done be through the web interface (as shown above) or by using the GoGrid API, which is a REST style web service API which provides all of the web interface functionality accessible with either Java, PHP, Python and Ruby.
Next we’ll take a look at Mosso, a cloud service backed by Rackspace.
Mosso
Mosso takes a slightly different approach from the other providers by deciding to merge the idea of cloud computing with the traditional managed/shared server environment that many web hosts provide. Mosso doesn’t provide root access to their severs but instead provide servers with operating systems and software pre-installed, much like a standard web host. This allows Mosso to easily monitor and scale the service as needed which frees the end user from having to worry about operating systems, devices, load balancing, etc.
To get started you first create an account at the Mosso website, and wait a few moments for a confirmation email. Once logged in, the control panel is displayed.

The configuration page provides some basic options including number of databases and web server technology.



Features
| Amazon EC2 | GoGrid | Mosso | |
| Windows Support | Yes (see Qemu) | Yes | Yes |
| Linux Support | Yes | Yes | Yes |
| Open Solaris Support | Yes | No | No |
| Graphical User Interface | No | Yes | Yes |
| Command Line | Yes | No | No |
| API | Yes | Yes | No |
| Root Access | Yes | Yes | No |
| SSH | Yes | Yes | No |
| FTP | Yes | Yes | Yes |
| Hardware Configurable | Yes | Yes | No |
Amazon is currently the only one offering custom images to be deployed to their servers. There is information on Amazon’s website for deploying Open Solaris based images and there are few sites which explain how to deploy Windows Server 2003. GoGrid does expect to provide the ability to create an image of any server in the future which theoretically would allow for additional operating system support.
All three providers allow for FTP access. Mosso does not provide full root access. Mosso is also the only one of the three compared here that does not provide any hardware configuration capabilities, although that is intentional and by design.
Pricing
Amazon EC2
There are three areas that have pricing associated with them including instance type (Standard vs High-CPU), Data Transfer and Elastic IP addresses.
A standard instance ranges from $0.10 per instance-hour to $0.80, and the High-CPU instances range from $0.20 - $0.80 per instance-hour. The Data Transfer rates vary based on where the data goes out to and comes in from (i.e. Internet, Availability Zone, Regional, etc) with pricing between $0.00 to $0.17 per GB transferred.
Lastly the Elastic IP addresses vary from free to $0.10 per Elastic IP address remap. It really depends on how the IP addresses are used throughout the month.
GoGrid
The rates for GoGrid are spread across Server RAM Hour, Outbound Data Transfer and Inbound Data Transfer. The pricing plan is much simpler with a set price of $0.19 per Server RAM Hour, $0.50 per GB of outbound data transferred, and all inbound data transfer is free.
Mosso
Mosso provides a standard flat rate of $100 per month which they expect will cover “most developers”. This includes:
Availability
Amongst the three services covered in this article only Mosso is available in “production” mode. Both Amazon EC2 and GoGrid are still labeled as being in “beta” although they are both being quickly adopted and maturing.
Thank you for your article, it was interesting and detailed. Some time ago I did a similar comparison of 8 cloud providers, too; maybe it can be useful. You can find it here.
It was a nice article on Cloud computing. I was only aware about Amazon EC2. Through this I was introduced to GoGrid and Mosso. Thanks Ashwin
I don't think you should put Windows as supported for EC2. Even though you can run Windows 2003 with Qemu on top of EC2, this configuration is not officially supported by Amazon. It is pretty slow and you cannot install SQL server for example because the install fails during hardware detection. In short this is not meant for production use.... not yet...
Ruby 1.9's Fibers and non-blocking I/O are getting more attention - we talked to Mohammad A. Ali of the NeverBlock project and Tony Arcieri of the Revactor project.
Tim Mackinnon talks about the aspirations behind the Agile principles and practices, the desire to become efficient, to write quality code which does not end up being thrown away.
Brian Goetz discusses the difficulties of creating multithreaded programs correctly, incorrect synchronization, race conditions, deadlock, STM, concurrency, alternatives to threads, Erlang, Scala.
Often the hardest part of changing technologies is language syntax differences. This new article provides Java developers with a transition guide to Actionscript which forms the foundation of Flex.
Neal Ford talks about having multiple languages running on one of the two major platforms: Java and .NET. He also presents the advantages offered by Ruby compared to static languages like Java or C#.
David Anderson talks about the history of Agile, the current status of it and his vision for the future. The role of Agile consists in finding ways to implement its principles.
Nick Sieger talks about the future of JRuby, Java Integration, and his work on JEE deployment tools for Ruby on Rails like Warbler.
Rustan Leino and Mike Barnett of Microsoft Research discuss the technology in Spec# and its futures.
3 comments
Reply