20140620075114!12305
Total Page:16
File Type:pdf, Size:1020Kb
Enhancement of Open Source Monitoring Tool for Small Footprint Databases Dissertation Submitted in partial fulfillment of the requirements for the degree of Master of Technology in Computer Science and Engineering Submitted by Sukh Deo Roll No. 123050061 Under the Guidance of Prof. Deepak B. Phatak Department of Computer Science and Engineering Indian Institute of Technology Bombay Powai, Mumbai, India 400076 June, 2014 Dissertation Approval Certificate Department of Computer Science and Engineering Indian Institute of Technology, Bombay The dissertation entitled \Enhancement of Open Source Monitoring Tool for Small Footprint Databases", submitted by Sukh Deo (Roll No: 123050061) is approved for the degree of Master of Technology in Computer Science and Engineering from Indian Institute of Technology, Bombay. Prof. Deepak B. Phatak Dept. of CSE, IIT Bombay Supervisor Internal Examiner External Examiner Place: IIT Bombay, Mumbai Date: June, 2014 Declaration I declare that this written submission represents my ideas in my own words and where other's ideas or words have been included, I have adequately cited and referenced the original sources. I also declare that I have adhered to all principles of academic honesty and integrity and have not misrepresented or fabricated or falsified any idea/data/fact/source in my submission. I un- derstand that any violation of the above will be cause for disciplinary action by the Institute and can also evoke penal action from the sources which have thus not been properly cited or from whom proper permission has not been taken when needed. Signature Name of Student Roll number Date 3 Acknowledgement I would like to thank my guide, Prof. Deepak B. Phatak, for the consistent encouragement and guidance throughout the project. Due to his consistent encouragement and right directions, we are able to do this project work. I would like to thank Mr. Nagesh Karmali for his continuous inputs in my work. I would also like to thank, Firuza Aibara, Prashant Kumar Singh, Arun Kumar, and B. Raju for proof reading this report and their valuable feedback. Abstract Nowadays, mobile devices are not only used for the basic purpose like calls and messages, but also for many others purposes and applications. We can say that mobile devices are siblings of personal computers. Their usage patterns are very different as compared to conventional PCs, since the mobile devices are targeted for general users. They do have some great features, e.g., lightweight and efficiency, but has some drawbacks like limited memory and battery issues. People now wants to use more and more applications to make life easier, but mobile device is able to manage the limited number of application. There is a need to measure the performance of mobile device. Our work starts with simple questions like the: does storage affect the performance of mobile devices? What kinds of databases are required for mobile devices? What are the parameters to measure the performance of databases? How to measure the performance of mobile device and its possible tools. Finally, we will enhance the performance of monitoring tool for small foot print database. Contents Acknowledgement . .4 1 Introduction 5 1.1 Motivation . .5 2 Literature Survey 7 2.1 Literature Survey on Small Footprint Databases . .7 2.1.1 Berkeley DB . .7 2.1.2 Perst DB . .9 2.1.3 SQLite DB . .9 2.1.4 Comparison among Berkeley DB, Perst DB, and SQLite DB . 10 2.2 Literature Survey on monitoring tool . 10 2.2.1 IOzone . 11 2.2.2 AndroBench . 12 2.2.3 MobiBench . 14 2.3 Conclusion . 14 3 Android Framework and SQLite Database 15 3.1 Android Framework . 15 3.1.1 Linux Kernel . 16 3.1.2 Libraries . 16 3.1.3 Android Runtime . 16 3.1.4 Application Framework . 16 3.2 Journal Mode of SQLite . 17 3.2.1 Rollback Journal . 17 3.2.2 Truncate Journaling Mode . 18 3.2.3 Persist Mode . 19 3.2.4 Write-Ahead Log(WAL) Mode . 19 4 MobiBench and Aakash Tablet Specifications 20 4.1 Overview of MobiBench . 20 4.1.1 Measure Tab . 20 4.1.2 History Tab . 21 4.1.3 Setting Tab . 21 4.2 Aakash Tablet Specification . 23 1 5 Test Result of MobiBench on Aakash Tablet 24 5.1 Testing Results on Aakash Tablet . 24 5.1.1 Test Cases for SQLite . 24 5.1.2 Test Result . 24 5.2 Battery consumption during testing . 26 6 Modification Done in MobiBench 27 6.1 Source code Analysis of MobiBench . 27 6.1.1 Possible Enhancement . 29 6.2 Modifications done to MobiBench Database . 30 7 Test Result after Modification of MobiBench on Aakash tablet 32 7.1 Testing Result after changes . 32 7.2 Result . 33 7.3 Battery consumption during testing . 33 8 Conclusion and Future Work 36 8.1 Conclusion . 36 8.2 Future Work . 37 2 List of Figures 1.1 Smart-phone's Users[1] . .6 2.1 Architecture of Berkeley DB[2] . .7 2.2 Architecture of SQLite[3] . .8 2.3 Structure of AndroBench Measure tab[4] . 13 2.4 AndroBench Setting tab[5] . 14 3.1 Android Framework [6] . 15 3.2 Simple architecture of Android framework . 16 3.3 Component require for Facebook application . 17 3.4 Roolback Journal of SQLite[7] . 18 4.1 Over all view of MobiBench[5] . 20 4.2 Setting tab[5] . 21 5.1 Overall performance of Aakash2 . 25 5.2 Database performance of Aakash2 . 25 5.3 Database performance of Aakash2 . 26 6.1 Control flow of MobiBench . 28 6.2 Default table schema . 28 6.3 Email system table schema . 29 6.4 Bowser history table schema . 29 6.5 WhatsApp table schema . 29 6.6 Choose table . 30 7.1 Database performance of Browser table in Aakash2 . 34 7.2 Database performance of Email System in Aakash2 . 34 7.3 Database performance of WhatsApp in Aakash2 . 35 8.1 Database performance using WAL mode . 36 3 List of Tables 5.1 Default setting of Mobibench . 24 5.2 Test cases for SQLite . 25 5.3 Database Performance of Aakash2 . 26 7.1 Database Performance of Browser History table in Aakash2 . 32 7.2 Throughtput Result of Email system table in transaction/s . 33 7.3 Throughtput Result of WhatsApp table in transaction/s . 33 4 Chapter 1 Introduction 1.1 Motivation Today's mobile devices are multi-functional devices. It provides usage for many applications, both business and consumer purposes. Smart phones and tablets allow people to access Internet for email, messages, and web browsing. A business person can install many applications like streamline work-flow, save time, keep data accessible, automate daily tasks, and many others. Consumers can view new goods and their prices on Internet, and many more tasks can be done by mobile devices, i.e., smart phones and tablets. We can work away from the office using these devices and can synchronize with our personal computer and can get the updated information. Due to the huge facility and light-weight property of mobile devices, there has been a huge market. People want to use many applications, but it has some limitations[8], like small memory and battery backup. It cannot manage large number of applications in these devices[9]. Today many research going on the application and service, device architecture, and operating system area[10] to make the optimal performance. Traditionally, storage was not viewed as a critical component of these devices, in term of expected performance, but now we got result that per- formance of mobile device depends on mobile database. Performance of mobile devices is to be to continuously improve to fulfill the desire of users to install and execute more applications. As we can see, some applications depend on the storage performance, i.e., quality of audio/video playback while number of applications are downloaded in background, storage of web browser history, and browsing speed all of which depends on stor- age performance. It is also required to use good file systems and I/O schedulers for optimizing the storage performance and to use the high speed of NAND flash memory. In Android mobile devices, SQLite is used both for system and application data, because SQLite is an embedded database. Example, if an Android application developer wants to make the Android application then he must use the database as SQLite for storing the related infor- mation like store the contacts, message, bookmarks of the web browser and many more. As we know each application uses separate database, speed of application depends on the speed of 5 Figure 1.1: Smart-phone's Users[1] database and the performance of mobile device depends on application that is installed. We came to the following conclusions that the factor of performance of mobile device depends on: • Mobile databases. • The hardware like, SD card, internal memory and processor. Due to demand of mobile devices in market, there is need to measure its performance, so that we can utilize maximum resources. Based on this motivation, we did the literature surveys on mobile databases and its monitoring tool, that we will discuss in the second chapter. We will also perform test on Aakash2 using MobiBench and we will also discuss possible way to enhance the performance of MobiBench and its modification. 6 Chapter 2 Literature Survey 2.1 Literature Survey on Small Footprint Databases I did literature study in several small footprint databases. Each database has its own charac- teristics, based on which we can decide more preferable database. We will analyze the features of Berkeley DB, Perst DB, and SQLite DB. Figure 2.1: Architecture of Berkeley DB[2] 2.1.1 Berkeley DB Berkeley DB is an embedded database[11].