User login

Register

English, ruby 1.9

  • warning: Parameter 1 to theme_fooaggregator_item_author() expected to be a reference, value given in /var/www/sites/aggregator/includes/theme.inc on line 171.
  • warning: Parameter 1 to theme_fooaggregator_item_author() expected to be a reference, value given in /var/www/sites/aggregator/includes/theme.inc on line 171.
  • warning: Parameter 1 to theme_fooaggregator_item_author() expected to be a reference, value given in /var/www/sites/aggregator/includes/theme.inc on line 171.
  • warning: Parameter 1 to theme_fooaggregator_item_author() expected to be a reference, value given in /var/www/sites/aggregator/includes/theme.inc on line 171.
  • warning: Parameter 1 to theme_fooaggregator_item_author() expected to be a reference, value given in /var/www/sites/aggregator/includes/theme.inc on line 171.
  • warning: Parameter 1 to theme_fooaggregator_item_author() expected to be a reference, value given in /var/www/sites/aggregator/includes/theme.inc on line 171.
  • warning: Parameter 1 to theme_fooaggregator_item_author() expected to be a reference, value given in /var/www/sites/aggregator/includes/theme.inc on line 171.

The Ruby 19x Web Servers Booklet

I have just finished a draft of my Ruby web server review, I have uploaded it to my scribd account, This is still a work in progress and I am looking at improving it further and may be include Unicorn tests as well.
Here is the document:
 read more »
No votes yet

Ruby Networking on Steroids

Ruby provides several socket classes for various connection protocols. Those classes are arranged in a strange and a convoluted hierarchy.
This ASCII diagram explains this hierarchy

IO
|
BasicSocket
|
|-- IPSocket
| |
| |-- TCPSocekt
| | |
| | |-- TCPServer
| | |
| | |-- SocksSocket
| |
| |-- UDPSocket
|
|-- Socket
|
|-- UNIXSocket
|
UNIXServer
 read more »
No votes yet

Building the Never Blocking Rails, Making Rails 12X Faster

They told you it can't be done, they told you it has no scale. They told you lies!

What if you suddenly had the ability to serve mutliple concurrent requests in a single Rails instance? What if you had the ability to multiplex IO operations from a single Rails instance?

No more what ifs. It has been done.
 read more »
No votes yet

ActiveRecord meets NeverBlock

I happily announce the release of the first NeverBlock enabled activerecord adapter. The neverblock-postgresql-adapter. This is a beta release but I have been testing it for a while now with great results.

And while this is a big improvement it only requires you to replace the driver name in the connection to neverblock_postgresql instead of postgresql as described in the official neverblock blog
 read more »
No votes yet

NeverBlock, much faster IO for Ruby

At eSpace we have just released an alpha version of NeverBlock. A library that aims to bring evented IO to the masses. It does so by wrapping all IO in Fibers which handle all the async aspects and hides them totally from the developers.

Just as a teaser, here are some benchmarks of running PostgreSQL queries with and without NeverBlock

 read more »
No votes yet

The case for a nonblocking Ruby stack

In a previous post I talked about the problems that plauge the web based Ruby applications regarding processor and memory use. I proposed using non-blocking IO as a solution to this problem. In a follow up post I benchmarked nonblocking vs blocking performance using the async facilities in the Ruby Postgres driver in combination with Ruby Fibers. The results were very promising (up to 40% improvement) that I decided to take the benchmarking effort one step further. I monkey patched the ruby postgres driver to be fiber aware and was able to integrate it into sequel with little to no effort.
 read more »
No votes yet

Ruby Fibers Vs Ruby Threads

Ruby 1.9 Fibers are touted as lightweight concurrency elements that are much lighter than threads. I have noticed a sizbale impact when I was benchmarking an application that made heavy use of fibers. So I wondered what If I switched to threads instead? After some time fighting with threads I decided I needed to write something specific for this comparison. I have written a small application that would spawn a number of fibers (or threads) and then would return the time went into this operation. I also recorded the VM size after the operation (all created fibers and threads are still reachable, hence, no garbage collection). I did not measure the cost of context switching for both approaches, may be in another time.

Here are the results for creation time:
 read more »
No votes yet

Syndicate content