Fabric Engine + Python: Value at Risk benchmark

February 10, 2012, Posted by Paul Doyle

Introduction

In this article, we revisit the Value-At-Risk algorithm that has been used to show the computational performance gains possible with Fabric Engine. It was first used to demonstrate the performance of Fabric Engine as a Node.js module (http://fabricengine.com/2011/11/server-performance-benchmarks) and then again to show Fabric’s performance as an asynchronous service within Node.js (http://fabricengine.com/2011/12/benchmark-node-js-value-at-risk-web-service ).

With the 1.0.20-beta release, Fabric Engine has introduced Python bindings, bringing Fabric Engine’s powerful and easy-to-use parallel computing capabilities to the Python language. This paper presents the performance of the Value-at-Risk algorithm implemented in Python and Fabric Engine, and compares the results to Fabric Engine’s previous findings as well as to a pure Python implementation. Its purpose is therefore to validate that the performance gains to using Fabric in a Node.js environment are also present in our Python integration.

Value-at-Risk in Python

The Node.js-based, JavaScript portion of our implementation of the Value-at-Risk algorithm was converted to Python. The KL code remains the same, of course, and so does the web interface. The source code has been added to https://github.com/fabric-engine/Benchmarks/tree/master/Server/ValueAtRisk . The details of the web interface can be found in the Node.js asynchronous service article at http://fabricengine.com/2011/12/benchmark-node-js-value-at-risk-web-service. The pure Python code is our own, single-threaded implementation of the algorithm; the reader is encouraged to produce a more optimized version for comparison.

Test Platform

We have used the same test configuration as in previous posts: an Amazon EC2 High-CPU Extra Large Instance (c1.xlarge) running Ubuntu 10.10 (64-bit). It has the following characteristics:
· 7 GB of memory
· 20 EC2 Compute Units (8 virtual cores with 2.5 EC2 Compute Units each)
· 1690 GB of instance storage
· 64-bit platform
· I/O Performance: High
· API name: c1.xlarge
The web service article provides more details on the methodology.

Test Results

The following chart shows the number of requests per second fulfilled by the pure Python implementation, the Node.js implementation, as well as two other implementations using Fabric Engine for computation, in Python and in Node.js.

The results are as expected, and indicate that Fabric Engine’s Python integration performs just as well as the Node.js integration. The Value-at-Risk algorithm is highly parallel, so Fabric is immediately able to use all available computing power, and then processes requests at a constant rate. A multi-threaded pure Python implementation could probably follow a similar profile, at the cost of writing an explicitly multi-threaded version of the algorithm itself, not just the request handling. A key benefit of Fabric Engine is that this work is unnecessary to obtain scaling with dynamic languages – Fabric Engine manages the low-level execution (memory, threading etc). As previously discussed in http://fabricengine.com/2011/12/benchmark-node-js-value-at-risk-web-service , simply firing a thread for each request will not result in a comparable performance curve, as the algorithm itself is extremely compute-intensive.

note: The Python benchmarks are only approximate, we only allowed the tests for 1, 2, 3 to run concurrently and only for up to 5 requests (the others tests went to 12 concurrent with 20 requests) as Python was so slow that it would have taken too long get full results. Python results were identical for those first 3 runs (as expected),  so we simply extrapolated the rest.

Licensing

Fabric Engine will be released under a dual license model – Fabric will be available as open-source software and commercial licensing/support options will be available. We expect to launch in March 2012.

Accessing the Python beta

Fabric Engine is currently in beta – to access the program, please go to http://fabricengine.com/developers/

Comments