Flash-memory system to make data centres more energy-efficient
Most modern websites store data in databases, and since database queries are relatively slow, most sites also maintain so-called cache servers, which list the results of common queries for faster access. A data centre for a major web service such as Google or Facebook might have as many as 1,000 servers dedicated just to caching.
Cache servers generally use random-access memory (RAM), which is fast but expensive and power-hungry. Researchers from the Computer Science and Artificial Intelligence Laboratory (CSAIL) at the Massachusetts Institute of Technology (MIT) have developed a new system for data centre caching that instead uses flash memory, the kind of memory used in most smartphones.
Per gigabyte of memory, flash consumes about 5% as much energy as RAM and costs about one-tenth as much. It also has about 100 times the storage density, meaning that more data can be crammed into a smaller space. In addition to costing less and consuming less power, a flash caching system could dramatically reduce the number of cache servers required by a data centre.
The drawback to flash is that it is much slower than RAM. "That's where the disbelief comes in," says Arvind, the Charles and Jennifer Johnson Professor in Computer Science Engineering at MIT. "People say, 'Really? You can do this with flash memory?' Access time in flash is 10,000 times longer than in DRAM [dynamic RAM]."
But slow as it is relative to DRAM, flash access is still much faster than human reactions to new sensory stimuli. Users will not notice the difference between a request that takes .0002 seconds to process - a typical round-trip travel time over the internet - and one that takes .0004 seconds to reach it.
The more important concern is keeping up with the requests flooding the data centre. The CSAIL researchers� system, dubbed BlueCache, does that by using the common computer science technique of 'pipelining'. Before a flash-based cache server returns the result of the first query to reach it, it can begin executing the next 10,000 queries. The first query might take 200 microseconds to process, but the responses to the succeeding ones will emerge at .02-microsecond intervals.
Even using pipelining, however, the CSAIL researchers had to deploy some clever engineering tricks to make flash caching competitive with DRAM caching. In tests, they compared BlueCache to what might be called the default implementation of a flash-based cache server, which is simply a data-centre database server configured for caching. (Although slow compared to DRAM, flash is much faster than magnetic hard drives, which it has all but replaced in data centres.) BlueCache was 4.2 times as fast as the default implementation.
A little DRAM
The researchers' first trick is to add a little DRAM to every BlueCache flash cache - a few megabytes per million megabytes of flash. The DRAM stores a table which pairs a database query with the flash-memory address of the corresponding query result. That does not make cache lookups any faster, but it makes the detection of cache misses - the identification of data not yet imported into the cache - much more efficient.
That little bit of DRAM does not compromise the system's energy savings. Indeed, because of all of its added efficiencies, BlueCache consumes only 4% as much power as the default implementation.
Ordinarily, a cache system has only three operations: reading a value from the cache, writing a new value to the cache, and deleting a value from the cache. Rather than rely on software to execute these operations, as the default implementation does, the researchers developed a special-purpose hardware circuit for each of them, increasing speed and lowering power consumption.
Inside a BlueCache server, the flash memory is connected to the central processor by a wire known as a 'bus', which, like any data connection, has a maximum capacity. BlueCache amasses enough queries to exhaust that capacity before sending them to memory, ensuring that the system is always using communication bandwidth as efficiently as possible.
With all these optimisations, BlueCache is able to perform write operations as efficiently as a DRAM-based system. Provided that each of the query results it is retrieving is at least 8 kb, it is as efficient at read operations, as well. (Because flash memory returns at least 8 kb of data for any request, its efficiency falls off for really small query results.)
BlueCache, like most data-centre caching systems, is a so-called key-value store, or KV store. In this case, the key is the database query and the value is the response.
"The flash-based KV store architecture developed by the MIT team resolves many of the issues that limit the ability of today's enterprise systems to harness the full potential of flash," says Vijay Balakrishnan, director of the Data Centre Performance and Ecosystem programme at Samsung Semiconductor's Memory Solutions Lab. "The viability of this type of system extends beyond caching, since many data-intensive applications use a KV-based software stack, which the MIT team has proven can now be eliminated. By integrating programmable chips with flash and rewriting the software stack, they have demonstrated that a fully scalable, performance-enhancing storage technology ... can greatly improve upon prevailing architectures."