Monday, June 20, 2011

Non-Blocking Resource Pools with Scala Actors

This blog post is in regard to my presentation at the most recent meetup of the Atlanta Scala Enthusiasts group.

Thanks to all of you who attended the meeting -- I had a great time.  A special thanks goes to Jon Steelman and Consilium1 for hosting the group!

The gist of the presentation was:

1) Multi-core processors allow massive concurrency
2) Thread-based concurrency won’t scale to massive
3) Event-based concurrency will scale to massive
4) Enterprise software must scale to pass on cost savings
5) Enterprise resource pools use threaded concurrency and won’t scale
6) Non-blocking resource pools use Scala Actors
7) Non-blocking resource pools can handle massive bursts
8) Non-blocking resource pools give back pressure signals and can be tuned

I presented an abstraction for non-blocking resource pools in Scala and demonstrated a resource pool of checksum accumulators.  The test program simulated bursts of 3,000, 10,000 and 5,000 requests contending for a pool of just 10 resources.  The test program then ran a rolling load of 500 requests every 2 seconds.

The server process handled the load well.  Throughput reached a maximum but the system continued to service the bursts at the expense of latency.

Some of the members discussed similar approaches where they used queuing middleware.  In general, I think it’s impressive that we can accomplish this safely (message-based concurrency) within the language itself without using other middleware.

My presentation slides have been posted at:

and source code has been posted at:

2 comments:

  1. Presentation and source code links lead to 404 page

    ReplyDelete
  2. Thank you. The links are fixed now.

    ReplyDelete