fast transaction logging for smartphones
play

Fast Transaction Logging for Smartphones Hao Luo , University of - PowerPoint PPT Presentation

Fast Transaction Logging for Smartphones Hao Luo , University of Nebraska Lincoln Hong Jiang , University of Texas Arlington Zhichao Yan , University of Texas Arlington Yaodong Yang , University of Nebraska Lincoln 1 Outline Introduction


  1. Fast Transaction Logging for Smartphones Hao Luo , University of Nebraska Lincoln Hong Jiang , University of Texas Arlington Zhichao Yan , University of Texas Arlington Yaodong Yang , University of Nebraska Lincoln 1

  2. Outline • Introduction • Logging Overhead in Mobile Databases • Design of xLog • Evaluation • Conclusion 2

  3. Introduction • The smartphones and tablets have become ubiquitous. • Storage subsystem impacts the application performance. • Database • File system 3

  4. Introduction • Database engines has become a crucial part of data management in mobile systems. • SQLite • LevelDB • Mobile databases employ logging to ensure data persistency • Atomicity • Consistency • Durability 4

  5. Introduction • Journal of journaling (JOJ) anomaly drastically slows down the mobile databases • Breaks the sequential pattern of log I/O • Writes more data. 5

  6. Transaction Commit Path Memory A DB file Log file 6

  7. Transaction Commit Path Memory A’ DB file Log file 7

  8. Transaction Commit Path Memory A’ Upon Txn Commit DB file Log file 8

  9. Transaction Logging • Value Logging • Logs after-image of the database pages • Used by SQLite • Command Logging • Logs transaction logic (e.g., SQL query) • Used by LevelDB 9

  10. SQLite Write Ahead Log • Logs modified database pages. • Header + modified pages • 4KB page size • fsync() upon transaction commit. 10

  11. LevelDB Logging • Logs transaction logic. • Put(): kTypeValue + key + value • Delete(): kTypeDeletion + key • fsync() upon commit (in synchronous mode) 11

  12. Logging Overhead • To assess the overhead of logging in mobile devices, we set up a simple benchmark test • 4 byte key, 100 byte value • 1000 insertion • Sequential / Random key order • Samsung Galaxsy S4 • Run the benchmark on different configurations • DB engine: SQLite, LevelDB • File system: Ext4, F2FS 12

  13. Logging Overhead 13

  14. Log File Size Log File Size (KB) 3500 3000 2500 2000 1500 1000 500 0 Seq Rnd Seq Rnd LevelDB SQLite Ext4 F2FS 14

  15. Log File Size • Log record size • SQLite: header + key + value (130 Byte) • LevelDB: header + modified pages (several KB) • SQLite’s value logging writes significantly more data to the log files. 15

  16. Data Written to Log File Data Written to Log File (KB) 8000 7000 6000 5000 4000 3000 2000 1000 0 Seq Rnd Seq Rnd LevelDB SQLite Ext4 F2FS 16

  17. Data Written to Log File • File system block • Data are flushed at file system block boundaries. • Usually 4KB in mobile devices. 17

  18. Data Written to Device Data Written to Device (KB) 30000 25000 20000 15000 10000 5000 0 Seq Rnd Seq Rnd LevelDB SQLite Ext4 F2FS 18

  19. qNVRAM • Nearly non-volatile memory in smartphones • Takes advantage of battery-backed nature of mobile devices. • Data survive almost all the failure conditions. • Application crash • Kernel panic • Hard reset 19

  20. xLog xLog Service Process App App qNVRAM Log file buffer Android Binder 20

  21. Evaluation • Microbenchmark • Raw performance of the xLog • Different log record size 21

  22. Micro-benchmark Performance 22

  23. Micro-benchmark Write Amplification 23

  24. Evaluation • Micro-benchmark • Raw performance of the xLog • Different log record size • Macro-benchmark • Transaction latency of LevelDB • xLog v.s. write()+fsync() • Different size of value 24

  25. Evaluation 3000 Logging Other 2417 2500 Average Latency ( µ s) 2174 2104 2050 2000 1500 1000 500 278 265 231 192 0 100 400 800 1600 100 400 800 1600 xLog write()+fsync() Value Size (Byte) 25

  26. Conclusion • In this paper we present xLog, a fast transaction logging service that uses qNVRAM as a buffer, for Android smartphones. • xLog logs up to 77x times faster than the tranditional logging scheme • xLog drastically reduces the write amplification from 122x to 1.6x. 26

  27. Thank you! Q & A 27

Recommend


More recommend