|
|
Hybrid SSD/RAM Memory Management Made Easy.
A Nearly-Transparent Programming Model for High-Performance Flash in Virtual Memory. |
|
Flash memory (mostly in the form of SSDs) is fast becoming an integral
part of a wide range of systems, including cell phones, netbooks,
laptops, desktops and servers. The integration is happening either in
the form of an SSD based swap space or SSD based secondary storage
filesystem or a complete rewrite of applications to act in a flash
aware manner (addressing slow random writes and limited lifetime
issues).
Applications are often rewritten to get the best performance out of an SSD. Rewriting is done to manage SSD as a log structured object/datastructure storage system while frequently accessed data is stored in RAM in a custom efficiently packed memory overlay. However, such rewriting often requires considerable programmer effort and many times involves rewriting well known algorithms and datastructures to be flash aware.
Swap and storage level integration solutions force a page granularity on all applications. For every byte read or written to an entire page is accessed from the SSD and then used in RAM. This not only reduces the SSD bandwidth but also decreases the usefulness of RAM by making it a page cache. Additionally, swap systems and filesystems which do not take into account the slow random write behavior and limited lifetime issues, take further performance hits. However, existing applications need not be modified to be able to use flash in this manner.
SSDAlloc is a hybrid SSD/RAM allocation tool that provides the best of both the worlds. It helps programmers build high-performance SSD applications (comparable to that of application rewrite) while requiring very few modifications to application code. It exposes a slab based memory allocation interface to the programmer and manages the data flow in and out of an SSD in a transparent manner using a backend runtime system. It also stores frequently used application data in a compact manner in RAM. The only modifications needed for a new application involve migrating to this slab allocator from traditional malloc/calloc memory allocation tools.
SSDAlloc is currently available on a research and/or commerical license. Please contact me if you are interested. The license covers the IP as well.
The following table sums up the benefits of SSDAlloc. With the ability
to migrate existing applications to use SSD as a memory with minimal
code modifications and achieve performance equivalent to that of
application rewrite one can scale performance of all types of
systems. For example, with 4TB of SSD as memory, a server with 128GB
of RAM can serve a large workload much faster when compared to a
server with a backend magnetic drive as a datastore. Similarly, a
netbook with an internal SSD of 16GB (and only 2GB of RAM) can become
an affordable server that can be used as a proxy cache/WAN accelerator
in developing regions.
Using SSDAlloc we modfied a few memory intensive applications
including Memcache, HashCache, a B+Tree index and a packet cache. With
less than 40 lines of modified code we obtain up to 17.5 times
improvement in performance over using SSD as a swap space (the
following table shows the details).