FREE TRANSACTIONS Free Transactions with WITH RIO VISTA Rio Vista David E. Lowell University of Michigan David E. Lowell Peter M. Chen Rio Project Electrical Engineering and Computer Science University of Michigan
FREE TRANSACTIONS The Problem WITH RIO VISTA David E. Lowell Writing or modifying permanent data is University of Michigan dangerous Example: Transferring money 1. Deduct $1,000,000 from Dave’s account 2. Add $1,000,000 to Pete’s account 3. Pete signs Dave’s thesis A crash in the middle of these steps leaves things corrupted!
FREE TRANSACTIONS A Solution WITH RIO VISTA David E. Lowell Use transactions to group these steps into University of Michigan an indivisible unit. Transaction 1. Deduct $1,000,000 from Dave’s account 0 2. Add $1,000,000 to Pete’s account 3. Pete signs Dave’s thesis a v
FREE TRANSACTIONS Transactions on Memory WITH RIO VISTA David E. Lowell An area of memory made persistent and University of Michigan updated within transactions Essence of a transaction Just atomicity, durability • No nesting, concurrency control • RVM is an example
A Transaction on Memory log transaction transaction truncation begin end writes . . . CPU CPU CPU CPU undo memory memory memory memory log database redo database redo database redo database redo log log log log
FREE TRANSACTIONS But... WITH RIO VISTA David E. Lowell Transactions are slow University of Michigan disk writes • system calls • copies • log management • Rio can help...
FREE TRANSACTIONS Introduction to Rio WITH RIO VISTA David E. Lowell Protects file cache during crash University of Michigan Restores file cache contents on reboot → file cache pages are persistent! Process mmap () write () File Cache I/O Disk
A Transaction with Rio log transaction transaction truncation begin end writes . . . CPU CPU CPU CPU undo memory memory memory memory log filecache filecache filecache filecache database redo database redo database redo database redo log log log log
FREE TRANSACTIONS Vista: A Transaction System WITH RIO VISTA Tailored for Rio David E. Lowell University of Michigan Application Space undo database log File Cache Maps persistent memory from Rio file cache all updates immediately permanent • no redo log needed • just undo updates on abort/crash •
A Vista Transaction transaction transaction begin writes end CPU CPU addr space addr space undo undo DB DB log log file cache file cache 1. Vista copies before-images to undo log 2. Application directly writes permanent data 3. Vista discards undo log on commit
Recovery in Vista Rio’s warm transaction reboot crash vista_map begin writes . . . . . . CPU CPU addr space addr space undo undo DB DB log log file cache file cache disk disk
FREE TRANSACTIONS Vista Highlights WITH RIO VISTA David E. Lowell Simplicity and Performance University of Michigan no disk I/O • no redo log • simple recovery • only 1 data copy • no system calls • only 720 lines in size • scales linearly with CPU speed •
FREE TRANSACTIONS Performance Evaluation WITH RIO VISTA David E. Lowell Benchmarks: University of Michigan Synthetic, Debit-Credit, Order-Entry Systems: RVM, RVM-Rio, Vista Platform: 175 MHz DEC Alpha 3000/600 workstation with 256 MB of memory. Separate disks for RVM database, log, and swap.
FREE TRANSACTIONS Transaction Overhead WITH RIO VISTA David E. Lowell University of 10 6 Michigan Transaction Overhead ( µ sec) 10 5 RVM 10 4 RVM-Rio 10 3 10 2 10 1 Vista 10 0 10 0 10 1 10 2 10 3 10 4 10 5 10 6 Transaction Size (bytes) synthetic benchmark
FREE TRANSACTIONS Transaction Throughput WITH RIO VISTA David E. Lowell University of 100,000 Michigan Vista Transactions/Second 10,000 RVM-Rio 1,000 RVM 100 10 0 100 200 300 Database Size (MB) debit-credit benchmark
FREE TRANSACTIONS Transaction Throughput WITH RIO VISTA David E. Lowell University of 100,000 Michigan Vista Transactions/Second 10,000 RVM-Rio 1,000 RVM 100 10 0 100 200 300 Database Size (MB) order-entry benchmark
FREE TRANSACTIONS Using Vista WITH RIO VISTA David E. Lowell What we do now: University of Michigan Persistent VM • Fine grained transactions • Explicit or implicit logging • Do mallocs and frees within transactions • Extending and using free transactions: Send and receive messages within • transactions Build inexpensive checkpointing and • persistent processes Build a DSM with persistence and • transactions
FREE TRANSACTIONS Conclusions WITH RIO VISTA David E. Lowell Vista is really fast University of Michigan Rio speeds up RVM by 20x • Vista gets another 100x (2000x total) • You can do neat stuff with free transactions Use transactions for fine-grained tasks • Reliable atomic messages, persistent • DSM, persistent processes, ... http://www.eecs.umich.edu/Rio
FREE TRANSACTIONS Isn’t Vista trivial? WITH RIO VISTA David E. Lowell RVM-Rio and Vista performance gap is still University of Michigan surprising Vista’s simplicity is an interesting result It’s really small • It’s really simple • It’s really fast • Isn’t that the ideal? •
FREE TRANSACTIONS What about concurrency? WITH RIO VISTA David E. Lowell Vista provides minimal transactions University of Michigan Many applications are single threaded • Concurrency schemes can be added as • needed in manner appropriate for each application Given ultra-fast transactions, • concurrency schemes can be simpler The lower the overhead of transactions, the more places they’ll be useful
FREE TRANSACTIONS Is Vista DB vulnerable? WITH RIO VISTA David E. Lowell Only two known quantitative studies of this University of Michigan effect Both Chen96 and Ng97 show data not corrupted substantially more than disk We map metadata in a separate region from user data Fixes “off-by-one” and “buffer overrun” errors which are very common failure modes Updates within transactions help Could use sandboxing or similar technique if really necessary
FREE TRANSACTIONS What about BIG databases? WITH RIO VISTA David E. Lowell No database works well when thrashing University of Michigan Vista’s reliable memory might help a bit • No double buffering or double paging • Vista is optimized for working sets that fit Vista is targeted for new, finer grained applications
FREE TRANSACTIONS What about group commit? WITH RIO VISTA David E. Lowell Group commit improves throughput for a University of Michigan group of transactions Vista improves latency for a single transaction Group commit is not a general solution Group commit is limited by disk bandwidth Vista is still 100x better than group commit
FREE TRANSACTIONS Transaction Throughput WITH RIO VISTA David E. Lowell University of 100,000 Michigan Vista Transactions/Second 10,000 RVM-group size 64 1,000 RVM-group size 8 100 RVM 10 0 100 200 300 Database Size (MB) debit-credit benchmark with group commit
Recommend
More recommend